From e8b2c776f72fa512ba0cb6265f9d6bbc1cad311c Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 29 Nov 2020 23:27:08 +0100 Subject: [PATCH] tools: upgrade to @babel/eslint-parser 7.12.1 PR-URL: https://github.com/nodejs/node/pull/36321 Fixes: https://github.com/ensure Reviewed-By: Rich Trott Reviewed-By: James M Snell --- .eslintrc.js | 13 +- test/parallel/test-assert.js | 2 +- .../@babel/code-frame => @babel/core}/LICENSE | 0 tools/node_modules/@babel/core/README.md | 19 + .../@babel/core/lib/config/caching.js | 327 + .../@babel/core/lib/config/config-chain.js | 552 + .../core/lib/config/config-descriptors.js | 211 + .../core/lib/config/files/configuration.js | 335 + .../@babel/core/lib/config/files/import.js | 10 + .../core/lib/config/files/index-browser.js | 68 + .../@babel/core/lib/config/files/index.js | 79 + .../core/lib/config/files/module-types.js | 96 + .../@babel/core/lib/config/files/package.js | 78 + .../@babel/core/lib/config/files/plugins.js | 169 + .../@babel/core/lib/config/files/types.js | 0 .../@babel/core/lib/config/files/utils.js | 48 + .../@babel/core/lib/config/full.js | 329 + .../core/lib/config/helpers/config-api.js | 85 + .../core/lib/config/helpers/environment.js | 10 + .../@babel/core/lib/config/index.js | 57 + .../@babel/core/lib/config/item.js | 78 + .../@babel/core/lib/config/partial.js | 187 + .../core/lib/config/pattern-to-regex.js | 52 + .../@babel/core/lib/config/plugin.js | 30 + .../@babel/core/lib/config/printer.js | 127 + .../@babel/core/lib/config/util.js | 35 + .../config/validation/option-assertions.js | 268 + .../core/lib/config/validation/options.js | 201 + .../core/lib/config/validation/plugins.js | 71 + .../core/lib/config/validation/removed.js | 66 + .../@babel/core/lib/gensync-utils/async.js | 89 + .../@babel/core/lib/gensync-utils/fs.js | 53 + .../@babel/core/lib/gensync-utils/resolve.js | 35 + tools/node_modules/@babel/core/lib/index.js | 266 + tools/node_modules/@babel/core/lib/parse.js | 50 + .../@babel/core/lib/parser/index.js | 97 + .../lib/parser/util/missing-plugin-helper.js | 307 + .../core/lib/tools/build-external-helpers.js | 148 + .../@babel/core/lib/transform-ast.js | 48 + .../@babel/core/lib/transform-file-browser.js | 26 + .../@babel/core/lib/transform-file.js | 45 + .../node_modules/@babel/core/lib/transform.js | 44 + .../lib/transformation/block-hoist-plugin.js | 68 + .../core/lib/transformation/file/file.js | 255 + .../core/lib/transformation/file/generate.js | 89 + .../core/lib/transformation/file/merge-map.js | 247 + .../@babel/core/lib/transformation/index.js | 126 + .../core/lib/transformation/normalize-file.js | 179 + .../core/lib/transformation/normalize-opts.js | 65 + .../core/lib/transformation/plugin-pass.js | 53 + .../node_modules/@babel/code-frame}/LICENSE | 0 .../node_modules/@babel/code-frame/README.md | 0 .../@babel/code-frame/lib/index.js | 18 +- .../@babel/code-frame/package.json | 34 +- .../node_modules/@babel/generator}/LICENSE | 0 .../node_modules/@babel/generator/README.md | 19 + .../@babel/generator/lib/buffer.js | 58 +- .../@babel/generator/lib/generators/base.js | 4 +- .../generator/lib/generators/classes.js | 66 +- .../generator/lib/generators/expressions.js | 32 +- .../@babel/generator/lib/generators/flow.js | 144 +- .../@babel/generator/lib/generators/index.js | 11 + .../@babel/generator/lib/generators/jsx.js | 0 .../generator/lib/generators/methods.js | 18 +- .../generator/lib/generators/modules.js | 49 +- .../generator/lib/generators/statements.js | 21 +- .../lib/generators/template-literals.js | 0 .../@babel/generator/lib/generators/types.js | 113 +- .../generator/lib/generators/typescript.js | 80 +- .../@babel/generator/lib/index.js | 4 +- .../@babel/generator/lib/node/index.js | 26 +- .../@babel/generator/lib/node/parentheses.js | 253 + .../@babel/generator/lib/node/whitespace.js | 63 +- .../@babel/generator/lib/printer.js | 122 +- .../@babel/generator/lib/source-map.js | 20 +- .../@babel/generator/package.json | 29 + .../@babel/helper-function-name}/LICENSE | 0 .../@babel/helper-function-name/README.md | 0 .../@babel/helper-function-name/lib/index.js | 72 +- .../@babel/helper-function-name/package.json | 21 + .../@babel/helper-get-function-arity}/LICENSE | 0 .../helper-get-function-arity/README.md | 0 .../helper-get-function-arity/lib/index.js | 26 + .../helper-get-function-arity/package.json | 19 + .../LICENSE | 0 .../README.md | 19 + .../lib/index.js | 386 + .../package.json | 19 + .../@babel/helper-module-imports}/LICENSE | 0 .../@babel/helper-module-imports/README.md | 19 + .../lib/import-builder.js | 139 + .../lib/import-injector.js | 271 + .../@babel/helper-module-imports/lib/index.js | 43 + .../helper-module-imports/lib/is-module.js | 18 + .../@babel/helper-module-imports/package.json | 23 + .../@babel/helper-module-transforms}/LICENSE | 4 +- .../@babel/helper-module-transforms/README.md | 19 + .../lib/get-module-name.js | 42 + .../helper-module-transforms/lib/index.js | 358 + .../lib/normalize-and-load-metadata.js | 368 + .../lib/rewrite-live-references.js | 297 + .../lib/rewrite-this.js | 31 + .../helper-module-transforms/package.json | 28 + .../helper-optimise-call-expression}/LICENSE | 2 +- .../helper-optimise-call-expression/README.md | 19 + .../lib/index.js | 30 + .../package.json | 22 + .../@babel/helper-replace-supers}/LICENSE | 2 +- .../@babel/helper-replace-supers/README.md | 19 + .../@babel/helper-replace-supers/lib/index.js | 255 + .../@babel/helper-replace-supers/package.json | 21 + .../@babel/helper-simple-access/LICENSE | 22 + .../@babel/helper-simple-access/README.md | 19 + .../@babel/helper-simple-access/lib/index.js | 79 + .../@babel/helper-simple-access/package.json | 20 + .../helper-split-export-declaration/LICENSE | 22 + .../helper-split-export-declaration/README.md | 0 .../lib/index.js | 24 +- .../package.json | 18 + .../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 | 21 + .../scripts/generate-identifier-regex.js | 75 + .../core/node_modules/@babel/helpers/LICENSE | 22 + .../node_modules/@babel/helpers/README.md | 19 + .../@babel/helpers/lib/helpers.js | 2078 ++++ .../node_modules/@babel/helpers/lib/index.js | 295 + .../node_modules/@babel/helpers/package.json | 25 + .../node_modules/@babel/highlight/LICENSE | 22 + .../node_modules/@babel/highlight/README.md | 0 .../@babel/highlight/lib/index.js | 46 +- .../@babel/highlight/package.json | 36 +- .../core}/node_modules/@babel/parser/LICENSE | 0 .../core/node_modules/@babel/parser/README.md | 19 + .../@babel/parser/bin/babel-parser.js | 11 +- .../node_modules/@babel/parser/lib/index.js | 9174 ++++++++++------- .../node_modules/@babel/parser/package.json | 57 +- .../core/node_modules/@babel/template/LICENSE | 22 + .../node_modules/@babel/template/README.md | 19 + .../@babel/template/lib/builder.js | 0 .../@babel/template/lib/formatters.js | 24 +- .../node_modules/@babel/template/lib/index.js | 4 +- .../@babel/template/lib/literal.js | 8 +- .../@babel/template/lib/options.js | 2 +- .../node_modules/@babel/template/lib/parse.js | 70 +- .../@babel/template/lib/populate.js | 46 +- .../@babel/template/lib/string.js | 0 .../node_modules/@babel/template/package.json | 22 + .../core/node_modules/@babel/traverse/LICENSE | 22 + .../node_modules/@babel/traverse/README.md | 2 +- .../node_modules/@babel/traverse/lib/cache.js | 0 .../@babel/traverse/lib/context.js | 25 +- .../node_modules/@babel/traverse/lib/hub.js | 0 .../node_modules/@babel/traverse/lib/index.js | 46 +- .../@babel/traverse/lib/path/ancestry.js | 16 +- .../@babel/traverse/lib/path/comments.js | 41 + .../@babel/traverse/lib/path/context.js | 40 +- .../@babel/traverse/lib/path/conversion.js | 181 +- .../@babel/traverse/lib/path/evaluation.js | 8 +- .../@babel/traverse/lib/path/family.js | 92 +- .../@babel/traverse/lib/path/index.js | 149 +- .../traverse/lib/path/inference/index.js | 140 + .../lib/path/inference/inferer-reference.js | 54 +- .../traverse/lib/path/inference/inferers.js | 110 +- .../@babel/traverse/lib/path/introspection.js | 194 +- .../@babel/traverse/lib/path/lib/hoister.js | 33 +- .../traverse/lib/path/lib/removal-hooks.js | 0 .../traverse/lib/path/lib/virtual-types.js | 52 +- .../@babel/traverse/lib/path/modification.js | 28 +- .../@babel/traverse/lib/path/removal.js | 14 +- .../@babel/traverse/lib/path/replacement.js | 86 +- .../@babel/traverse/lib/scope/binding.js | 8 +- .../@babel/traverse/lib/scope/index.js | 449 +- .../@babel/traverse/lib/scope/lib/renamer.js | 37 +- .../@babel/traverse/lib/visitors.js | 38 +- .../node_modules/@babel/traverse/package.json | 31 + .../core/node_modules/@babel/types/LICENSE | 22 + .../core/node_modules/@babel/types/README.md | 19 + .../@babel/types/lib/asserts/assertNode.js | 4 +- .../types/lib/asserts/generated/index.js | 212 +- .../@babel/types/lib/builders/builder.js | 12 +- .../lib/builders/flow/createFlowUnionType.js} | 4 +- .../flow/createTypeAnnotationBasedOnTypeof.js | 0 .../types/lib/builders/generated/index.js | 1243 +++ .../types/lib/builders/react/buildChildren.js | 0 .../builders/typescript/createTSUnionType.js | 23 + .../@babel/types/lib/clone/clone.js | 0 .../@babel/types/lib/clone/cloneDeep.js | 0 .../types/lib/clone/cloneDeepWithoutLoc.js | 14 + .../@babel/types/lib/clone/cloneNode.js | 101 + .../@babel/types/lib/clone/cloneWithoutLoc.js | 6 +- .../@babel/types/lib/comments/addComment.js | 0 .../@babel/types/lib/comments/addComments.js | 0 .../lib/comments/inheritInnerComments.js | 0 .../lib/comments/inheritLeadingComments.js | 0 .../lib/comments/inheritTrailingComments.js | 0 .../types/lib/comments/inheritsComments.js | 0 .../types/lib/comments/removeComments.js | 0 .../types/lib/constants/generated/index.js | 10 +- .../@babel/types/lib/constants/index.js | 4 +- .../types/lib/converters/ensureBlock.js | 0 .../converters/gatherSequenceExpressions.js | 8 +- .../lib/converters/toBindingIdentifierName.js | 0 .../@babel/types/lib/converters/toBlock.js | 0 .../types/lib/converters/toComputedKey.js | 0 .../types/lib/converters/toExpression.js | 0 .../types/lib/converters/toIdentifier.js | 0 .../@babel/types/lib/converters/toKeyAlias.js | 0 .../lib/converters/toSequenceExpression.js | 2 +- .../types/lib/converters/toStatement.js | 0 .../types/lib/converters/valueToNode.js | 24 +- .../@babel/types/lib/definitions/core.js | 1488 +++ .../types/lib/definitions/experimental.js | 155 +- .../@babel/types/lib/definitions/flow.js | 77 +- .../@babel/types/lib/definitions/index.js | 34 +- .../@babel/types/lib/definitions/jsx.js | 15 +- .../@babel/types/lib/definitions/misc.js | 33 + .../types/lib/definitions/placeholders.js | 2 +- .../types/lib/definitions/typescript.js | 40 +- .../@babel/types/lib/definitions/utils.js | 108 +- .../node_modules/@babel/types/lib/index.js | 35 +- .../@babel/types/lib/index.js.flow | 898 +- .../modifications/appendToMemberExpression.js | 0 .../flow/removeTypeDuplicates.js | 0 .../types/lib/modifications/inherits.js | 0 .../prependToMemberExpression.js | 0 .../lib/modifications/removeProperties.js | 0 .../lib/modifications/removePropertiesDeep.js | 0 .../typescript/removeTypeDuplicates.js | 54 + .../lib/retrievers/getBindingIdentifiers.js | 0 .../retrievers/getOuterBindingIdentifiers.js | 0 .../@babel/types/lib/traverse/traverse.js | 0 .../@babel/types/lib/traverse/traverseFast.js | 0 .../@babel/types/lib/utils/inherit.js | 12 + .../react/cleanJSXElementLiteralChild.js | 0 .../@babel/types/lib/utils/shallowEqual.js | 0 .../validators/buildMatchMemberExpression.js | 0 .../types/lib/validators/generated/index.js | 512 +- .../@babel/types/lib/validators/is.js | 0 .../@babel/types/lib/validators/isBinding.js | 0 .../types/lib/validators/isBlockScoped.js | 0 .../types/lib/validators/isImmutable.js | 0 .../@babel/types/lib/validators/isLet.js | 0 .../@babel/types/lib/validators/isNode.js | 0 .../types/lib/validators/isNodesEquivalent.js | 2 +- .../types/lib/validators/isPlaceholderType.js | 0 .../types/lib/validators/isReferenced.js | 10 +- .../@babel/types/lib/validators/isScope.js | 20 + .../lib/validators/isSpecifierDefault.js | 0 .../@babel/types/lib/validators/isType.js | 0 .../lib/validators/isValidES3Identifier.js | 0 .../types/lib/validators/isValidIdentifier.js | 22 + .../@babel/types/lib/validators/isVar.js | 0 .../types/lib/validators/matchesPattern.js | 0 .../types/lib/validators/react/isCompatTag.js | 0 .../lib/validators/react/isReactComponent.js | 0 .../@babel/types/lib/validators/validate.js | 11 +- .../node_modules/@babel/types/package.json | 35 + .../types/scripts/generateTypeHelpers.js | 0 .../@babel/types/scripts/generators/docs.js | 14 +- .../@babel/types/scripts/generators/flow.js | 257 + .../scripts/generators/generateAsserts.js | 3 +- .../scripts/generators/generateBuilders.js | 22 +- .../scripts/generators/generateConstants.js | 0 .../scripts/generators/generateValidators.js | 0 .../types/scripts/generators/typescript.js | 381 + .../types/scripts/utils/formatBuilderName.js | 3 +- .../@babel/types/scripts/utils/lowerFirst.js | 0 .../types/scripts/utils/stringifyValidator.js | 0 .../types/scripts/utils/toFunctionName.js | 0 .../core}/node_modules/ansi-styles/index.js | 0 .../core}/node_modules/ansi-styles/license | 0 .../node_modules/ansi-styles/package.json | 56 + .../core}/node_modules/ansi-styles/readme.md | 0 .../core}/node_modules/chalk/index.js | 0 .../core}/node_modules/chalk/index.js.flow | 0 .../core}/node_modules/chalk/license | 0 .../core/node_modules/chalk/package.json | 71 + .../core}/node_modules/chalk/readme.md | 0 .../core}/node_modules/chalk/templates.js | 0 .../core}/node_modules/color-convert/LICENSE | 0 .../node_modules/color-convert/README.md | 0 .../node_modules/color-convert/conversions.js | 0 .../core}/node_modules/color-convert/index.js | 0 .../node_modules/color-convert/package.json | 56 +- .../core}/node_modules/color-convert/route.js | 0 .../core}/node_modules/color-name/LICENSE | 0 .../core}/node_modules/color-name/README.md | 0 .../core}/node_modules/color-name/index.js | 0 .../node_modules/color-name/package.json | 33 +- .../node_modules/convert-source-map/LICENSE | 23 + .../node_modules/convert-source-map/README.md | 125 + .../node_modules/convert-source-map/index.js | 136 + .../convert-source-map/package.json | 44 + .../core}/node_modules/debug/LICENSE | 0 .../core}/node_modules/debug/README.md | 0 .../core/node_modules/debug/package.json | 59 + .../core}/node_modules/debug/src/browser.js | 25 +- .../core}/node_modules/debug/src/common.js | 51 +- .../core}/node_modules/debug/src/index.js | 0 .../core}/node_modules/debug/src/node.js | 8 +- .../escape-string-regexp/index.js | 0 .../node_modules/escape-string-regexp/license | 0 .../escape-string-regexp/package.json | 41 + .../escape-string-regexp/readme.md | 0 .../node_modules/function-bind/.jscs.json | 176 + .../core/node_modules/function-bind/LICENSE | 20 + .../core/node_modules/function-bind/README.md | 48 + .../function-bind/implementation.js | 52 + .../core/node_modules/function-bind/index.js | 5 + .../node_modules/function-bind/package.json | 63 + .../@babel/core/node_modules/gensync/LICENSE | 7 + .../core/node_modules/gensync/README.md | 196 + .../@babel/core/node_modules/gensync/index.js | 373 + .../core/node_modules/gensync/index.js.flow | 32 + .../core/node_modules/gensync/package.json | 37 + .../core}/node_modules/globals/globals.json | 0 .../core}/node_modules/globals/index.js | 0 .../core}/node_modules/globals/license | 0 .../core/node_modules/globals/package.json | 41 + .../core}/node_modules/globals/readme.md | 0 .../core}/node_modules/has-flag/index.js | 0 .../core}/node_modules/has-flag/license | 0 .../core}/node_modules/has-flag/package.json | 35 +- .../core}/node_modules/has-flag/readme.md | 0 .../@babel/core/node_modules/has/LICENSE-MIT | 22 + .../@babel/core/node_modules/has/README.md | 18 + .../@babel/core/node_modules/has/package.json | 48 + .../@babel/core/node_modules/has/src/index.js | 5 + .../core/node_modules/is-core-module/LICENSE | 20 + .../node_modules/is-core-module/README.md | 37 + .../node_modules/is-core-module/core.json | 83 + .../core/node_modules/is-core-module/index.js | 69 + .../node_modules/is-core-module/package.json | 66 + .../core}/node_modules/js-tokens/LICENSE | 0 .../core}/node_modules/js-tokens/README.md | 0 .../core}/node_modules/js-tokens/index.js | 0 .../core}/node_modules/js-tokens/package.json | 47 +- .../core}/node_modules/jsesc/LICENSE-MIT.txt | 0 .../core}/node_modules/jsesc/README.md | 0 .../core}/node_modules/jsesc/bin/jsesc | 0 .../core}/node_modules/jsesc/jsesc.js | 0 .../core}/node_modules/jsesc/man/jsesc.1 | 0 .../core}/node_modules/jsesc/package.json | 66 +- .../@babel/core/node_modules/json5/LICENSE.md | 23 + .../@babel/core/node_modules/json5/README.md | 234 + .../core/node_modules/json5/dist/index.js | 1710 +++ .../core/node_modules/json5/dist/index.min.js | 1 + .../node_modules/json5/dist/index.min.mjs | 1 + .../core/node_modules/json5/dist/index.mjs | 1399 +++ .../@babel/core/node_modules/json5/lib/cli.js | 112 + .../core/node_modules/json5/lib/index.js | 9 + .../core/node_modules/json5/lib/parse.js | 1087 ++ .../core/node_modules/json5/lib/register.js | 13 + .../core/node_modules/json5/lib/require.js | 4 + .../core/node_modules/json5/lib/stringify.js | 261 + .../core/node_modules/json5/lib/unicode.js | 4 + .../core/node_modules/json5/lib/util.js | 35 + .../core/node_modules/json5/package.json | 71 + .../core}/node_modules/lodash/LICENSE | 0 .../core}/node_modules/lodash/README.md | 4 +- .../core}/node_modules/lodash/_DataView.js | 0 .../core}/node_modules/lodash/_Hash.js | 0 .../core}/node_modules/lodash/_LazyWrapper.js | 0 .../core}/node_modules/lodash/_ListCache.js | 0 .../node_modules/lodash/_LodashWrapper.js | 0 .../core}/node_modules/lodash/_Map.js | 0 .../core}/node_modules/lodash/_MapCache.js | 0 .../core}/node_modules/lodash/_Promise.js | 0 .../core}/node_modules/lodash/_Set.js | 0 .../core}/node_modules/lodash/_SetCache.js | 0 .../core}/node_modules/lodash/_Stack.js | 0 .../core}/node_modules/lodash/_Symbol.js | 0 .../core}/node_modules/lodash/_Uint8Array.js | 0 .../core}/node_modules/lodash/_WeakMap.js | 0 .../core}/node_modules/lodash/_apply.js | 0 .../node_modules/lodash/_arrayAggregator.js | 0 .../core}/node_modules/lodash/_arrayEach.js | 0 .../node_modules/lodash/_arrayEachRight.js | 0 .../core}/node_modules/lodash/_arrayEvery.js | 0 .../core}/node_modules/lodash/_arrayFilter.js | 0 .../node_modules/lodash/_arrayIncludes.js | 0 .../node_modules/lodash/_arrayIncludesWith.js | 0 .../node_modules/lodash/_arrayLikeKeys.js | 0 .../core}/node_modules/lodash/_arrayMap.js | 0 .../core}/node_modules/lodash/_arrayPush.js | 0 .../core}/node_modules/lodash/_arrayReduce.js | 0 .../node_modules/lodash/_arrayReduceRight.js | 0 .../core}/node_modules/lodash/_arraySample.js | 0 .../node_modules/lodash/_arraySampleSize.js | 0 .../node_modules/lodash/_arrayShuffle.js | 0 .../core}/node_modules/lodash/_arraySome.js | 0 .../core}/node_modules/lodash/_asciiSize.js | 0 .../node_modules/lodash/_asciiToArray.js | 0 .../core}/node_modules/lodash/_asciiWords.js | 0 .../node_modules/lodash/_assignMergeValue.js | 0 .../core}/node_modules/lodash/_assignValue.js | 0 .../node_modules/lodash/_assocIndexOf.js | 0 .../node_modules/lodash/_baseAggregator.js | 0 .../core}/node_modules/lodash/_baseAssign.js | 0 .../node_modules/lodash/_baseAssignIn.js | 0 .../node_modules/lodash/_baseAssignValue.js | 0 .../core}/node_modules/lodash/_baseAt.js | 0 .../core}/node_modules/lodash/_baseClamp.js | 0 .../core}/node_modules/lodash/_baseClone.js | 3 +- .../node_modules/lodash/_baseConforms.js | 0 .../node_modules/lodash/_baseConformsTo.js | 0 .../core}/node_modules/lodash/_baseCreate.js | 0 .../core}/node_modules/lodash/_baseDelay.js | 0 .../node_modules/lodash/_baseDifference.js | 0 .../core}/node_modules/lodash/_baseEach.js | 0 .../node_modules/lodash/_baseEachRight.js | 0 .../core}/node_modules/lodash/_baseEvery.js | 0 .../node_modules/lodash/_baseExtremum.js | 0 .../core}/node_modules/lodash/_baseFill.js | 0 .../core}/node_modules/lodash/_baseFilter.js | 0 .../node_modules/lodash/_baseFindIndex.js | 0 .../core}/node_modules/lodash/_baseFindKey.js | 0 .../core}/node_modules/lodash/_baseFlatten.js | 0 .../core}/node_modules/lodash/_baseFor.js | 0 .../core}/node_modules/lodash/_baseForOwn.js | 0 .../node_modules/lodash/_baseForOwnRight.js | 0 .../node_modules/lodash/_baseForRight.js | 0 .../node_modules/lodash/_baseFunctions.js | 0 .../core}/node_modules/lodash/_baseGet.js | 0 .../node_modules/lodash/_baseGetAllKeys.js | 0 .../core}/node_modules/lodash/_baseGetTag.js | 0 .../core}/node_modules/lodash/_baseGt.js | 0 .../core}/node_modules/lodash/_baseHas.js | 0 .../core}/node_modules/lodash/_baseHasIn.js | 0 .../core}/node_modules/lodash/_baseInRange.js | 0 .../core}/node_modules/lodash/_baseIndexOf.js | 0 .../node_modules/lodash/_baseIndexOfWith.js | 0 .../node_modules/lodash/_baseIntersection.js | 0 .../node_modules/lodash/_baseInverter.js | 0 .../core}/node_modules/lodash/_baseInvoke.js | 0 .../node_modules/lodash/_baseIsArguments.js | 0 .../node_modules/lodash/_baseIsArrayBuffer.js | 0 .../core}/node_modules/lodash/_baseIsDate.js | 0 .../core}/node_modules/lodash/_baseIsEqual.js | 0 .../node_modules/lodash/_baseIsEqualDeep.js | 0 .../core}/node_modules/lodash/_baseIsMap.js | 0 .../core}/node_modules/lodash/_baseIsMatch.js | 0 .../core}/node_modules/lodash/_baseIsNaN.js | 0 .../node_modules/lodash/_baseIsNative.js | 0 .../node_modules/lodash/_baseIsRegExp.js | 0 .../core}/node_modules/lodash/_baseIsSet.js | 0 .../node_modules/lodash/_baseIsTypedArray.js | 0 .../node_modules/lodash/_baseIteratee.js | 0 .../core}/node_modules/lodash/_baseKeys.js | 0 .../core}/node_modules/lodash/_baseKeysIn.js | 0 .../core}/node_modules/lodash/_baseLodash.js | 0 .../core}/node_modules/lodash/_baseLt.js | 0 .../core}/node_modules/lodash/_baseMap.js | 0 .../core}/node_modules/lodash/_baseMatches.js | 0 .../lodash/_baseMatchesProperty.js | 0 .../core}/node_modules/lodash/_baseMean.js | 0 .../core}/node_modules/lodash/_baseMerge.js | 0 .../node_modules/lodash/_baseMergeDeep.js | 0 .../core}/node_modules/lodash/_baseNth.js | 0 .../core}/node_modules/lodash/_baseOrderBy.js | 19 +- .../core}/node_modules/lodash/_basePick.js | 0 .../core}/node_modules/lodash/_basePickBy.js | 0 .../node_modules/lodash/_baseProperty.js | 0 .../node_modules/lodash/_basePropertyDeep.js | 0 .../node_modules/lodash/_basePropertyOf.js | 0 .../core}/node_modules/lodash/_basePullAll.js | 0 .../core}/node_modules/lodash/_basePullAt.js | 0 .../core}/node_modules/lodash/_baseRandom.js | 0 .../core}/node_modules/lodash/_baseRange.js | 0 .../core}/node_modules/lodash/_baseReduce.js | 0 .../core}/node_modules/lodash/_baseRepeat.js | 0 .../core}/node_modules/lodash/_baseRest.js | 0 .../core}/node_modules/lodash/_baseSample.js | 0 .../node_modules/lodash/_baseSampleSize.js | 0 .../core}/node_modules/lodash/_baseSet.js | 4 + .../core}/node_modules/lodash/_baseSetData.js | 0 .../node_modules/lodash/_baseSetToString.js | 0 .../core}/node_modules/lodash/_baseShuffle.js | 0 .../core}/node_modules/lodash/_baseSlice.js | 0 .../core}/node_modules/lodash/_baseSome.js | 0 .../core}/node_modules/lodash/_baseSortBy.js | 0 .../node_modules/lodash/_baseSortedIndex.js | 0 .../node_modules/lodash/_baseSortedIndexBy.js | 11 +- .../node_modules/lodash/_baseSortedUniq.js | 0 .../core}/node_modules/lodash/_baseSum.js | 0 .../core}/node_modules/lodash/_baseTimes.js | 0 .../node_modules/lodash/_baseToNumber.js | 0 .../core}/node_modules/lodash/_baseToPairs.js | 0 .../node_modules/lodash/_baseToString.js | 0 .../core}/node_modules/lodash/_baseUnary.js | 0 .../core}/node_modules/lodash/_baseUniq.js | 0 .../core}/node_modules/lodash/_baseUnset.js | 0 .../core}/node_modules/lodash/_baseUpdate.js | 0 .../core}/node_modules/lodash/_baseValues.js | 0 .../core}/node_modules/lodash/_baseWhile.js | 0 .../node_modules/lodash/_baseWrapperValue.js | 0 .../core}/node_modules/lodash/_baseXor.js | 0 .../node_modules/lodash/_baseZipObject.js | 0 .../core}/node_modules/lodash/_cacheHas.js | 0 .../lodash/_castArrayLikeObject.js | 0 .../node_modules/lodash/_castFunction.js | 0 .../core}/node_modules/lodash/_castPath.js | 0 .../core}/node_modules/lodash/_castRest.js | 0 .../core}/node_modules/lodash/_castSlice.js | 0 .../node_modules/lodash/_charsEndIndex.js | 0 .../node_modules/lodash/_charsStartIndex.js | 0 .../node_modules/lodash/_cloneArrayBuffer.js | 0 .../core}/node_modules/lodash/_cloneBuffer.js | 0 .../node_modules/lodash/_cloneDataView.js | 0 .../core}/node_modules/lodash/_cloneRegExp.js | 0 .../core}/node_modules/lodash/_cloneSymbol.js | 0 .../node_modules/lodash/_cloneTypedArray.js | 0 .../node_modules/lodash/_compareAscending.js | 0 .../node_modules/lodash/_compareMultiple.js | 0 .../core}/node_modules/lodash/_composeArgs.js | 0 .../node_modules/lodash/_composeArgsRight.js | 0 .../core}/node_modules/lodash/_copyArray.js | 0 .../core}/node_modules/lodash/_copyObject.js | 0 .../core}/node_modules/lodash/_copySymbols.js | 0 .../node_modules/lodash/_copySymbolsIn.js | 0 .../core}/node_modules/lodash/_coreJsData.js | 0 .../node_modules/lodash/_countHolders.js | 0 .../node_modules/lodash/_createAggregator.js | 0 .../node_modules/lodash/_createAssigner.js | 0 .../node_modules/lodash/_createBaseEach.js | 0 .../node_modules/lodash/_createBaseFor.js | 0 .../core}/node_modules/lodash/_createBind.js | 0 .../node_modules/lodash/_createCaseFirst.js | 0 .../node_modules/lodash/_createCompounder.js | 0 .../core}/node_modules/lodash/_createCtor.js | 0 .../core}/node_modules/lodash/_createCurry.js | 0 .../core}/node_modules/lodash/_createFind.js | 0 .../core}/node_modules/lodash/_createFlow.js | 0 .../node_modules/lodash/_createHybrid.js | 0 .../node_modules/lodash/_createInverter.js | 0 .../lodash/_createMathOperation.js | 0 .../core}/node_modules/lodash/_createOver.js | 0 .../node_modules/lodash/_createPadding.js | 0 .../node_modules/lodash/_createPartial.js | 0 .../core}/node_modules/lodash/_createRange.js | 0 .../node_modules/lodash/_createRecurry.js | 0 .../lodash/_createRelationalOperation.js | 0 .../core}/node_modules/lodash/_createRound.js | 0 .../core}/node_modules/lodash/_createSet.js | 0 .../node_modules/lodash/_createToPairs.js | 0 .../core}/node_modules/lodash/_createWrap.js | 0 .../lodash/_customDefaultsAssignIn.js | 0 .../lodash/_customDefaultsMerge.js | 0 .../node_modules/lodash/_customOmitClone.js | 0 .../node_modules/lodash/_deburrLetter.js | 0 .../node_modules/lodash/_defineProperty.js | 0 .../core}/node_modules/lodash/_equalArrays.js | 9 +- .../core}/node_modules/lodash/_equalByTag.js | 0 .../node_modules/lodash/_equalObjects.js | 9 +- .../node_modules/lodash/_escapeHtmlChar.js | 0 .../node_modules/lodash/_escapeStringChar.js | 0 .../core}/node_modules/lodash/_flatRest.js | 0 .../core}/node_modules/lodash/_freeGlobal.js | 0 .../core}/node_modules/lodash/_getAllKeys.js | 0 .../node_modules/lodash/_getAllKeysIn.js | 0 .../core}/node_modules/lodash/_getData.js | 0 .../core}/node_modules/lodash/_getFuncName.js | 0 .../core}/node_modules/lodash/_getHolder.js | 0 .../core}/node_modules/lodash/_getMapData.js | 0 .../node_modules/lodash/_getMatchData.js | 0 .../core}/node_modules/lodash/_getNative.js | 0 .../node_modules/lodash/_getPrototype.js | 0 .../core}/node_modules/lodash/_getRawTag.js | 0 .../core}/node_modules/lodash/_getSymbols.js | 0 .../node_modules/lodash/_getSymbolsIn.js | 0 .../core}/node_modules/lodash/_getTag.js | 0 .../core}/node_modules/lodash/_getValue.js | 0 .../core}/node_modules/lodash/_getView.js | 0 .../node_modules/lodash/_getWrapDetails.js | 0 .../core}/node_modules/lodash/_hasPath.js | 0 .../core}/node_modules/lodash/_hasUnicode.js | 0 .../node_modules/lodash/_hasUnicodeWord.js | 0 .../core}/node_modules/lodash/_hashClear.js | 0 .../core}/node_modules/lodash/_hashDelete.js | 0 .../core}/node_modules/lodash/_hashGet.js | 0 .../core}/node_modules/lodash/_hashHas.js | 0 .../core}/node_modules/lodash/_hashSet.js | 0 .../node_modules/lodash/_initCloneArray.js | 0 .../node_modules/lodash/_initCloneByTag.js | 0 .../node_modules/lodash/_initCloneObject.js | 0 .../node_modules/lodash/_insertWrapDetails.js | 0 .../node_modules/lodash/_isFlattenable.js | 0 .../core}/node_modules/lodash/_isIndex.js | 0 .../node_modules/lodash/_isIterateeCall.js | 0 .../core}/node_modules/lodash/_isKey.js | 0 .../core}/node_modules/lodash/_isKeyable.js | 0 .../core}/node_modules/lodash/_isLaziable.js | 0 .../core}/node_modules/lodash/_isMaskable.js | 0 .../core}/node_modules/lodash/_isMasked.js | 0 .../core}/node_modules/lodash/_isPrototype.js | 0 .../lodash/_isStrictComparable.js | 0 .../node_modules/lodash/_iteratorToArray.js | 0 .../core}/node_modules/lodash/_lazyClone.js | 0 .../core}/node_modules/lodash/_lazyReverse.js | 0 .../core}/node_modules/lodash/_lazyValue.js | 0 .../node_modules/lodash/_listCacheClear.js | 0 .../node_modules/lodash/_listCacheDelete.js | 0 .../node_modules/lodash/_listCacheGet.js | 0 .../node_modules/lodash/_listCacheHas.js | 0 .../node_modules/lodash/_listCacheSet.js | 0 .../node_modules/lodash/_mapCacheClear.js | 0 .../node_modules/lodash/_mapCacheDelete.js | 0 .../core}/node_modules/lodash/_mapCacheGet.js | 0 .../core}/node_modules/lodash/_mapCacheHas.js | 0 .../core}/node_modules/lodash/_mapCacheSet.js | 0 .../core}/node_modules/lodash/_mapToArray.js | 0 .../lodash/_matchesStrictComparable.js | 0 .../node_modules/lodash/_memoizeCapped.js | 0 .../core}/node_modules/lodash/_mergeData.js | 0 .../core}/node_modules/lodash/_metaMap.js | 0 .../node_modules/lodash/_nativeCreate.js | 0 .../core}/node_modules/lodash/_nativeKeys.js | 0 .../node_modules/lodash/_nativeKeysIn.js | 0 .../core}/node_modules/lodash/_nodeUtil.js | 0 .../node_modules/lodash/_objectToString.js | 0 .../core}/node_modules/lodash/_overArg.js | 0 .../core}/node_modules/lodash/_overRest.js | 0 .../core}/node_modules/lodash/_parent.js | 0 .../core}/node_modules/lodash/_reEscape.js | 0 .../core}/node_modules/lodash/_reEvaluate.js | 0 .../node_modules/lodash/_reInterpolate.js | 0 .../core}/node_modules/lodash/_realNames.js | 0 .../core}/node_modules/lodash/_reorder.js | 0 .../node_modules/lodash/_replaceHolders.js | 0 .../core}/node_modules/lodash/_root.js | 0 .../core}/node_modules/lodash/_safeGet.js | 0 .../core}/node_modules/lodash/_setCacheAdd.js | 0 .../core}/node_modules/lodash/_setCacheHas.js | 0 .../core}/node_modules/lodash/_setData.js | 0 .../core}/node_modules/lodash/_setToArray.js | 0 .../core}/node_modules/lodash/_setToPairs.js | 0 .../core}/node_modules/lodash/_setToString.js | 0 .../node_modules/lodash/_setWrapToString.js | 0 .../core}/node_modules/lodash/_shortOut.js | 0 .../core}/node_modules/lodash/_shuffleSelf.js | 0 .../core}/node_modules/lodash/_stackClear.js | 0 .../core}/node_modules/lodash/_stackDelete.js | 0 .../core}/node_modules/lodash/_stackGet.js | 0 .../core}/node_modules/lodash/_stackHas.js | 0 .../core}/node_modules/lodash/_stackSet.js | 0 .../node_modules/lodash/_strictIndexOf.js | 0 .../node_modules/lodash/_strictLastIndexOf.js | 0 .../core}/node_modules/lodash/_stringSize.js | 0 .../node_modules/lodash/_stringToArray.js | 0 .../node_modules/lodash/_stringToPath.js | 0 .../core}/node_modules/lodash/_toKey.js | 0 .../core}/node_modules/lodash/_toSource.js | 0 .../node_modules/lodash/_unescapeHtmlChar.js | 0 .../core}/node_modules/lodash/_unicodeSize.js | 0 .../node_modules/lodash/_unicodeToArray.js | 0 .../node_modules/lodash/_unicodeWords.js | 0 .../node_modules/lodash/_updateWrapDetails.js | 0 .../node_modules/lodash/_wrapperClone.js | 0 .../core}/node_modules/lodash/add.js | 0 .../core}/node_modules/lodash/after.js | 0 .../core}/node_modules/lodash/array.js | 0 .../core}/node_modules/lodash/ary.js | 0 .../core}/node_modules/lodash/assign.js | 0 .../core}/node_modules/lodash/assignIn.js | 0 .../core}/node_modules/lodash/assignInWith.js | 0 .../core}/node_modules/lodash/assignWith.js | 0 .../core}/node_modules/lodash/at.js | 0 .../core}/node_modules/lodash/attempt.js | 0 .../core}/node_modules/lodash/before.js | 0 .../core}/node_modules/lodash/bind.js | 0 .../core}/node_modules/lodash/bindAll.js | 0 .../core}/node_modules/lodash/bindKey.js | 0 .../core}/node_modules/lodash/camelCase.js | 0 .../core}/node_modules/lodash/capitalize.js | 0 .../core}/node_modules/lodash/castArray.js | 0 .../core}/node_modules/lodash/ceil.js | 0 .../core}/node_modules/lodash/chain.js | 0 .../core}/node_modules/lodash/chunk.js | 0 .../core}/node_modules/lodash/clamp.js | 0 .../core}/node_modules/lodash/clone.js | 0 .../core}/node_modules/lodash/cloneDeep.js | 0 .../node_modules/lodash/cloneDeepWith.js | 0 .../core}/node_modules/lodash/cloneWith.js | 0 .../core}/node_modules/lodash/collection.js | 0 .../core}/node_modules/lodash/commit.js | 0 .../core}/node_modules/lodash/compact.js | 0 .../core}/node_modules/lodash/concat.js | 0 .../core}/node_modules/lodash/cond.js | 0 .../core}/node_modules/lodash/conforms.js | 0 .../core}/node_modules/lodash/conformsTo.js | 0 .../core}/node_modules/lodash/constant.js | 0 .../core}/node_modules/lodash/core.js | 31 +- .../core/node_modules/lodash/core.min.js | 30 + .../core}/node_modules/lodash/countBy.js | 0 .../core}/node_modules/lodash/create.js | 0 .../core}/node_modules/lodash/curry.js | 0 .../core}/node_modules/lodash/curryRight.js | 0 .../core}/node_modules/lodash/date.js | 0 .../core}/node_modules/lodash/debounce.js | 0 .../core}/node_modules/lodash/deburr.js | 0 .../core}/node_modules/lodash/defaultTo.js | 0 .../core}/node_modules/lodash/defaults.js | 0 .../core}/node_modules/lodash/defaultsDeep.js | 0 .../core}/node_modules/lodash/defer.js | 0 .../core}/node_modules/lodash/delay.js | 0 .../core}/node_modules/lodash/difference.js | 0 .../core}/node_modules/lodash/differenceBy.js | 0 .../node_modules/lodash/differenceWith.js | 0 .../core}/node_modules/lodash/divide.js | 0 .../core}/node_modules/lodash/drop.js | 0 .../core}/node_modules/lodash/dropRight.js | 0 .../node_modules/lodash/dropRightWhile.js | 0 .../core}/node_modules/lodash/dropWhile.js | 0 .../core}/node_modules/lodash/each.js | 0 .../core}/node_modules/lodash/eachRight.js | 0 .../core}/node_modules/lodash/endsWith.js | 0 .../core}/node_modules/lodash/entries.js | 0 .../core}/node_modules/lodash/entriesIn.js | 0 .../core}/node_modules/lodash/eq.js | 0 .../core}/node_modules/lodash/escape.js | 0 .../core}/node_modules/lodash/escapeRegExp.js | 0 .../core}/node_modules/lodash/every.js | 0 .../core}/node_modules/lodash/extend.js | 0 .../core}/node_modules/lodash/extendWith.js | 0 .../core}/node_modules/lodash/fill.js | 0 .../core}/node_modules/lodash/filter.js | 4 + .../core}/node_modules/lodash/find.js | 0 .../core}/node_modules/lodash/findIndex.js | 0 .../core}/node_modules/lodash/findKey.js | 0 .../core}/node_modules/lodash/findLast.js | 0 .../node_modules/lodash/findLastIndex.js | 0 .../core}/node_modules/lodash/findLastKey.js | 0 .../core}/node_modules/lodash/first.js | 0 .../core}/node_modules/lodash/flatMap.js | 0 .../core}/node_modules/lodash/flatMapDeep.js | 0 .../core}/node_modules/lodash/flatMapDepth.js | 0 .../core}/node_modules/lodash/flatten.js | 0 .../core}/node_modules/lodash/flattenDeep.js | 0 .../core}/node_modules/lodash/flattenDepth.js | 0 .../core}/node_modules/lodash/flip.js | 0 .../core}/node_modules/lodash/floor.js | 0 .../core}/node_modules/lodash/flow.js | 0 .../core}/node_modules/lodash/flowRight.js | 0 .../core}/node_modules/lodash/forEach.js | 0 .../core}/node_modules/lodash/forEachRight.js | 0 .../core}/node_modules/lodash/forIn.js | 0 .../core}/node_modules/lodash/forInRight.js | 0 .../core}/node_modules/lodash/forOwn.js | 0 .../core}/node_modules/lodash/forOwnRight.js | 0 .../core}/node_modules/lodash/fp.js | 0 .../core}/node_modules/lodash/fp/F.js | 0 .../core}/node_modules/lodash/fp/T.js | 0 .../core}/node_modules/lodash/fp/__.js | 0 .../node_modules/lodash/fp/_baseConvert.js | 0 .../node_modules/lodash/fp/_convertBrowser.js | 0 .../node_modules/lodash/fp/_falseOptions.js | 0 .../core}/node_modules/lodash/fp/_mapping.js | 0 .../core}/node_modules/lodash/fp/_util.js | 0 .../core}/node_modules/lodash/fp/add.js | 0 .../core}/node_modules/lodash/fp/after.js | 0 .../core}/node_modules/lodash/fp/all.js | 0 .../core}/node_modules/lodash/fp/allPass.js | 0 .../core}/node_modules/lodash/fp/always.js | 0 .../core}/node_modules/lodash/fp/any.js | 0 .../core}/node_modules/lodash/fp/anyPass.js | 0 .../core}/node_modules/lodash/fp/apply.js | 0 .../core}/node_modules/lodash/fp/array.js | 0 .../core}/node_modules/lodash/fp/ary.js | 0 .../core}/node_modules/lodash/fp/assign.js | 0 .../core}/node_modules/lodash/fp/assignAll.js | 0 .../node_modules/lodash/fp/assignAllWith.js | 0 .../core}/node_modules/lodash/fp/assignIn.js | 0 .../node_modules/lodash/fp/assignInAll.js | 0 .../node_modules/lodash/fp/assignInAllWith.js | 0 .../node_modules/lodash/fp/assignInWith.js | 0 .../node_modules/lodash/fp/assignWith.js | 0 .../core}/node_modules/lodash/fp/assoc.js | 0 .../core}/node_modules/lodash/fp/assocPath.js | 0 .../core}/node_modules/lodash/fp/at.js | 0 .../core}/node_modules/lodash/fp/attempt.js | 0 .../core}/node_modules/lodash/fp/before.js | 0 .../core}/node_modules/lodash/fp/bind.js | 0 .../core}/node_modules/lodash/fp/bindAll.js | 0 .../core}/node_modules/lodash/fp/bindKey.js | 0 .../core}/node_modules/lodash/fp/camelCase.js | 0 .../node_modules/lodash/fp/capitalize.js | 0 .../core}/node_modules/lodash/fp/castArray.js | 0 .../core}/node_modules/lodash/fp/ceil.js | 0 .../core}/node_modules/lodash/fp/chain.js | 0 .../core}/node_modules/lodash/fp/chunk.js | 0 .../core}/node_modules/lodash/fp/clamp.js | 0 .../core}/node_modules/lodash/fp/clone.js | 0 .../core}/node_modules/lodash/fp/cloneDeep.js | 0 .../node_modules/lodash/fp/cloneDeepWith.js | 0 .../core}/node_modules/lodash/fp/cloneWith.js | 0 .../node_modules/lodash/fp/collection.js | 0 .../core}/node_modules/lodash/fp/commit.js | 0 .../core}/node_modules/lodash/fp/compact.js | 0 .../node_modules/lodash/fp/complement.js | 0 .../core}/node_modules/lodash/fp/compose.js | 0 .../core}/node_modules/lodash/fp/concat.js | 0 .../core}/node_modules/lodash/fp/cond.js | 0 .../core}/node_modules/lodash/fp/conforms.js | 0 .../node_modules/lodash/fp/conformsTo.js | 0 .../core}/node_modules/lodash/fp/constant.js | 0 .../core}/node_modules/lodash/fp/contains.js | 0 .../core}/node_modules/lodash/fp/convert.js | 0 .../core}/node_modules/lodash/fp/countBy.js | 0 .../core}/node_modules/lodash/fp/create.js | 0 .../core}/node_modules/lodash/fp/curry.js | 0 .../core}/node_modules/lodash/fp/curryN.js | 0 .../node_modules/lodash/fp/curryRight.js | 0 .../node_modules/lodash/fp/curryRightN.js | 0 .../core}/node_modules/lodash/fp/date.js | 0 .../core}/node_modules/lodash/fp/debounce.js | 0 .../core}/node_modules/lodash/fp/deburr.js | 0 .../core}/node_modules/lodash/fp/defaultTo.js | 0 .../core}/node_modules/lodash/fp/defaults.js | 0 .../node_modules/lodash/fp/defaultsAll.js | 0 .../node_modules/lodash/fp/defaultsDeep.js | 0 .../node_modules/lodash/fp/defaultsDeepAll.js | 0 .../core}/node_modules/lodash/fp/defer.js | 0 .../core}/node_modules/lodash/fp/delay.js | 0 .../node_modules/lodash/fp/difference.js | 0 .../node_modules/lodash/fp/differenceBy.js | 0 .../node_modules/lodash/fp/differenceWith.js | 0 .../core}/node_modules/lodash/fp/dissoc.js | 0 .../node_modules/lodash/fp/dissocPath.js | 0 .../core}/node_modules/lodash/fp/divide.js | 0 .../core}/node_modules/lodash/fp/drop.js | 0 .../core}/node_modules/lodash/fp/dropLast.js | 0 .../node_modules/lodash/fp/dropLastWhile.js | 0 .../core}/node_modules/lodash/fp/dropRight.js | 0 .../node_modules/lodash/fp/dropRightWhile.js | 0 .../core}/node_modules/lodash/fp/dropWhile.js | 0 .../core}/node_modules/lodash/fp/each.js | 0 .../core}/node_modules/lodash/fp/eachRight.js | 0 .../core}/node_modules/lodash/fp/endsWith.js | 0 .../core}/node_modules/lodash/fp/entries.js | 0 .../core}/node_modules/lodash/fp/entriesIn.js | 0 .../core}/node_modules/lodash/fp/eq.js | 0 .../core}/node_modules/lodash/fp/equals.js | 0 .../core}/node_modules/lodash/fp/escape.js | 0 .../node_modules/lodash/fp/escapeRegExp.js | 0 .../core}/node_modules/lodash/fp/every.js | 0 .../core}/node_modules/lodash/fp/extend.js | 0 .../core}/node_modules/lodash/fp/extendAll.js | 0 .../node_modules/lodash/fp/extendAllWith.js | 0 .../node_modules/lodash/fp/extendWith.js | 0 .../core}/node_modules/lodash/fp/fill.js | 0 .../core}/node_modules/lodash/fp/filter.js | 0 .../core}/node_modules/lodash/fp/find.js | 0 .../core}/node_modules/lodash/fp/findFrom.js | 0 .../core}/node_modules/lodash/fp/findIndex.js | 0 .../node_modules/lodash/fp/findIndexFrom.js | 0 .../core}/node_modules/lodash/fp/findKey.js | 0 .../core}/node_modules/lodash/fp/findLast.js | 0 .../node_modules/lodash/fp/findLastFrom.js | 0 .../node_modules/lodash/fp/findLastIndex.js | 0 .../lodash/fp/findLastIndexFrom.js | 0 .../node_modules/lodash/fp/findLastKey.js | 0 .../core}/node_modules/lodash/fp/first.js | 0 .../core}/node_modules/lodash/fp/flatMap.js | 0 .../node_modules/lodash/fp/flatMapDeep.js | 0 .../node_modules/lodash/fp/flatMapDepth.js | 0 .../core}/node_modules/lodash/fp/flatten.js | 0 .../node_modules/lodash/fp/flattenDeep.js | 0 .../node_modules/lodash/fp/flattenDepth.js | 0 .../core}/node_modules/lodash/fp/flip.js | 0 .../core}/node_modules/lodash/fp/floor.js | 0 .../core}/node_modules/lodash/fp/flow.js | 0 .../core}/node_modules/lodash/fp/flowRight.js | 0 .../core}/node_modules/lodash/fp/forEach.js | 0 .../node_modules/lodash/fp/forEachRight.js | 0 .../core}/node_modules/lodash/fp/forIn.js | 0 .../node_modules/lodash/fp/forInRight.js | 0 .../core}/node_modules/lodash/fp/forOwn.js | 0 .../node_modules/lodash/fp/forOwnRight.js | 0 .../core}/node_modules/lodash/fp/fromPairs.js | 0 .../core}/node_modules/lodash/fp/function.js | 0 .../core}/node_modules/lodash/fp/functions.js | 0 .../node_modules/lodash/fp/functionsIn.js | 0 .../core}/node_modules/lodash/fp/get.js | 0 .../core}/node_modules/lodash/fp/getOr.js | 0 .../core}/node_modules/lodash/fp/groupBy.js | 0 .../core}/node_modules/lodash/fp/gt.js | 0 .../core}/node_modules/lodash/fp/gte.js | 0 .../core}/node_modules/lodash/fp/has.js | 0 .../core}/node_modules/lodash/fp/hasIn.js | 0 .../core}/node_modules/lodash/fp/head.js | 0 .../core}/node_modules/lodash/fp/identical.js | 0 .../core}/node_modules/lodash/fp/identity.js | 0 .../core}/node_modules/lodash/fp/inRange.js | 0 .../core}/node_modules/lodash/fp/includes.js | 0 .../node_modules/lodash/fp/includesFrom.js | 0 .../core}/node_modules/lodash/fp/indexBy.js | 0 .../core}/node_modules/lodash/fp/indexOf.js | 0 .../node_modules/lodash/fp/indexOfFrom.js | 0 .../core}/node_modules/lodash/fp/init.js | 0 .../core}/node_modules/lodash/fp/initial.js | 0 .../node_modules/lodash/fp/intersection.js | 0 .../node_modules/lodash/fp/intersectionBy.js | 0 .../lodash/fp/intersectionWith.js | 0 .../core}/node_modules/lodash/fp/invert.js | 0 .../core}/node_modules/lodash/fp/invertBy.js | 0 .../core}/node_modules/lodash/fp/invertObj.js | 0 .../core}/node_modules/lodash/fp/invoke.js | 0 .../node_modules/lodash/fp/invokeArgs.js | 0 .../node_modules/lodash/fp/invokeArgsMap.js | 0 .../core}/node_modules/lodash/fp/invokeMap.js | 0 .../node_modules/lodash/fp/isArguments.js | 0 .../core}/node_modules/lodash/fp/isArray.js | 0 .../node_modules/lodash/fp/isArrayBuffer.js | 0 .../node_modules/lodash/fp/isArrayLike.js | 0 .../lodash/fp/isArrayLikeObject.js | 0 .../core}/node_modules/lodash/fp/isBoolean.js | 0 .../core}/node_modules/lodash/fp/isBuffer.js | 0 .../core}/node_modules/lodash/fp/isDate.js | 0 .../core}/node_modules/lodash/fp/isElement.js | 0 .../core}/node_modules/lodash/fp/isEmpty.js | 0 .../core}/node_modules/lodash/fp/isEqual.js | 0 .../node_modules/lodash/fp/isEqualWith.js | 0 .../core}/node_modules/lodash/fp/isError.js | 0 .../core}/node_modules/lodash/fp/isFinite.js | 0 .../node_modules/lodash/fp/isFunction.js | 0 .../core}/node_modules/lodash/fp/isInteger.js | 0 .../core}/node_modules/lodash/fp/isLength.js | 0 .../core}/node_modules/lodash/fp/isMap.js | 0 .../core}/node_modules/lodash/fp/isMatch.js | 0 .../node_modules/lodash/fp/isMatchWith.js | 0 .../core}/node_modules/lodash/fp/isNaN.js | 0 .../core}/node_modules/lodash/fp/isNative.js | 0 .../core}/node_modules/lodash/fp/isNil.js | 0 .../core}/node_modules/lodash/fp/isNull.js | 0 .../core}/node_modules/lodash/fp/isNumber.js | 0 .../core}/node_modules/lodash/fp/isObject.js | 0 .../node_modules/lodash/fp/isObjectLike.js | 0 .../node_modules/lodash/fp/isPlainObject.js | 0 .../core}/node_modules/lodash/fp/isRegExp.js | 0 .../node_modules/lodash/fp/isSafeInteger.js | 0 .../core}/node_modules/lodash/fp/isSet.js | 0 .../core}/node_modules/lodash/fp/isString.js | 0 .../core}/node_modules/lodash/fp/isSymbol.js | 0 .../node_modules/lodash/fp/isTypedArray.js | 0 .../node_modules/lodash/fp/isUndefined.js | 0 .../core}/node_modules/lodash/fp/isWeakMap.js | 0 .../core}/node_modules/lodash/fp/isWeakSet.js | 0 .../core}/node_modules/lodash/fp/iteratee.js | 0 .../core}/node_modules/lodash/fp/join.js | 0 .../core}/node_modules/lodash/fp/juxt.js | 0 .../core}/node_modules/lodash/fp/kebabCase.js | 0 .../core}/node_modules/lodash/fp/keyBy.js | 0 .../core}/node_modules/lodash/fp/keys.js | 0 .../core}/node_modules/lodash/fp/keysIn.js | 0 .../core}/node_modules/lodash/fp/lang.js | 0 .../core}/node_modules/lodash/fp/last.js | 0 .../node_modules/lodash/fp/lastIndexOf.js | 0 .../node_modules/lodash/fp/lastIndexOfFrom.js | 0 .../core}/node_modules/lodash/fp/lowerCase.js | 0 .../node_modules/lodash/fp/lowerFirst.js | 0 .../core}/node_modules/lodash/fp/lt.js | 0 .../core}/node_modules/lodash/fp/lte.js | 0 .../core}/node_modules/lodash/fp/map.js | 0 .../core}/node_modules/lodash/fp/mapKeys.js | 0 .../core}/node_modules/lodash/fp/mapValues.js | 0 .../core}/node_modules/lodash/fp/matches.js | 0 .../node_modules/lodash/fp/matchesProperty.js | 0 .../core}/node_modules/lodash/fp/math.js | 0 .../core}/node_modules/lodash/fp/max.js | 0 .../core}/node_modules/lodash/fp/maxBy.js | 0 .../core}/node_modules/lodash/fp/mean.js | 0 .../core}/node_modules/lodash/fp/meanBy.js | 0 .../core}/node_modules/lodash/fp/memoize.js | 0 .../core}/node_modules/lodash/fp/merge.js | 0 .../core}/node_modules/lodash/fp/mergeAll.js | 0 .../node_modules/lodash/fp/mergeAllWith.js | 0 .../core}/node_modules/lodash/fp/mergeWith.js | 0 .../core}/node_modules/lodash/fp/method.js | 0 .../core}/node_modules/lodash/fp/methodOf.js | 0 .../core}/node_modules/lodash/fp/min.js | 0 .../core}/node_modules/lodash/fp/minBy.js | 0 .../core}/node_modules/lodash/fp/mixin.js | 0 .../core}/node_modules/lodash/fp/multiply.js | 0 .../core}/node_modules/lodash/fp/nAry.js | 0 .../core}/node_modules/lodash/fp/negate.js | 0 .../core}/node_modules/lodash/fp/next.js | 0 .../core}/node_modules/lodash/fp/noop.js | 0 .../core}/node_modules/lodash/fp/now.js | 0 .../core}/node_modules/lodash/fp/nth.js | 0 .../core}/node_modules/lodash/fp/nthArg.js | 0 .../core}/node_modules/lodash/fp/number.js | 0 .../core}/node_modules/lodash/fp/object.js | 0 .../core}/node_modules/lodash/fp/omit.js | 0 .../core}/node_modules/lodash/fp/omitAll.js | 0 .../core}/node_modules/lodash/fp/omitBy.js | 0 .../core}/node_modules/lodash/fp/once.js | 0 .../core}/node_modules/lodash/fp/orderBy.js | 0 .../core}/node_modules/lodash/fp/over.js | 0 .../core}/node_modules/lodash/fp/overArgs.js | 0 .../core}/node_modules/lodash/fp/overEvery.js | 0 .../core}/node_modules/lodash/fp/overSome.js | 0 .../core}/node_modules/lodash/fp/pad.js | 0 .../core}/node_modules/lodash/fp/padChars.js | 0 .../node_modules/lodash/fp/padCharsEnd.js | 0 .../node_modules/lodash/fp/padCharsStart.js | 0 .../core}/node_modules/lodash/fp/padEnd.js | 0 .../core}/node_modules/lodash/fp/padStart.js | 0 .../core}/node_modules/lodash/fp/parseInt.js | 0 .../core}/node_modules/lodash/fp/partial.js | 0 .../node_modules/lodash/fp/partialRight.js | 0 .../core}/node_modules/lodash/fp/partition.js | 0 .../core}/node_modules/lodash/fp/path.js | 0 .../core}/node_modules/lodash/fp/pathEq.js | 0 .../core}/node_modules/lodash/fp/pathOr.js | 0 .../core}/node_modules/lodash/fp/paths.js | 0 .../core}/node_modules/lodash/fp/pick.js | 0 .../core}/node_modules/lodash/fp/pickAll.js | 0 .../core}/node_modules/lodash/fp/pickBy.js | 0 .../core}/node_modules/lodash/fp/pipe.js | 0 .../node_modules/lodash/fp/placeholder.js | 0 .../core}/node_modules/lodash/fp/plant.js | 0 .../core}/node_modules/lodash/fp/pluck.js | 0 .../core}/node_modules/lodash/fp/prop.js | 0 .../core}/node_modules/lodash/fp/propEq.js | 0 .../core}/node_modules/lodash/fp/propOr.js | 0 .../core}/node_modules/lodash/fp/property.js | 0 .../node_modules/lodash/fp/propertyOf.js | 0 .../core}/node_modules/lodash/fp/props.js | 0 .../core}/node_modules/lodash/fp/pull.js | 0 .../core}/node_modules/lodash/fp/pullAll.js | 0 .../core}/node_modules/lodash/fp/pullAllBy.js | 0 .../node_modules/lodash/fp/pullAllWith.js | 0 .../core}/node_modules/lodash/fp/pullAt.js | 0 .../core}/node_modules/lodash/fp/random.js | 0 .../core}/node_modules/lodash/fp/range.js | 0 .../node_modules/lodash/fp/rangeRight.js | 0 .../core}/node_modules/lodash/fp/rangeStep.js | 0 .../node_modules/lodash/fp/rangeStepRight.js | 0 .../core}/node_modules/lodash/fp/rearg.js | 0 .../core}/node_modules/lodash/fp/reduce.js | 0 .../node_modules/lodash/fp/reduceRight.js | 0 .../core}/node_modules/lodash/fp/reject.js | 0 .../core}/node_modules/lodash/fp/remove.js | 0 .../core}/node_modules/lodash/fp/repeat.js | 0 .../core}/node_modules/lodash/fp/replace.js | 0 .../core}/node_modules/lodash/fp/rest.js | 0 .../core}/node_modules/lodash/fp/restFrom.js | 0 .../core}/node_modules/lodash/fp/result.js | 0 .../core}/node_modules/lodash/fp/reverse.js | 0 .../core}/node_modules/lodash/fp/round.js | 0 .../core}/node_modules/lodash/fp/sample.js | 0 .../node_modules/lodash/fp/sampleSize.js | 0 .../core}/node_modules/lodash/fp/seq.js | 0 .../core}/node_modules/lodash/fp/set.js | 0 .../core}/node_modules/lodash/fp/setWith.js | 0 .../core}/node_modules/lodash/fp/shuffle.js | 0 .../core}/node_modules/lodash/fp/size.js | 0 .../core}/node_modules/lodash/fp/slice.js | 0 .../core}/node_modules/lodash/fp/snakeCase.js | 0 .../core}/node_modules/lodash/fp/some.js | 0 .../core}/node_modules/lodash/fp/sortBy.js | 0 .../node_modules/lodash/fp/sortedIndex.js | 0 .../node_modules/lodash/fp/sortedIndexBy.js | 0 .../node_modules/lodash/fp/sortedIndexOf.js | 0 .../node_modules/lodash/fp/sortedLastIndex.js | 0 .../lodash/fp/sortedLastIndexBy.js | 0 .../lodash/fp/sortedLastIndexOf.js | 0 .../node_modules/lodash/fp/sortedUniq.js | 0 .../node_modules/lodash/fp/sortedUniqBy.js | 0 .../core}/node_modules/lodash/fp/split.js | 0 .../core}/node_modules/lodash/fp/spread.js | 0 .../node_modules/lodash/fp/spreadFrom.js | 0 .../core}/node_modules/lodash/fp/startCase.js | 0 .../node_modules/lodash/fp/startsWith.js | 0 .../core}/node_modules/lodash/fp/string.js | 0 .../core}/node_modules/lodash/fp/stubArray.js | 0 .../core}/node_modules/lodash/fp/stubFalse.js | 0 .../node_modules/lodash/fp/stubObject.js | 0 .../node_modules/lodash/fp/stubString.js | 0 .../core}/node_modules/lodash/fp/stubTrue.js | 0 .../core}/node_modules/lodash/fp/subtract.js | 0 .../core}/node_modules/lodash/fp/sum.js | 0 .../core}/node_modules/lodash/fp/sumBy.js | 0 .../lodash/fp/symmetricDifference.js | 0 .../lodash/fp/symmetricDifferenceBy.js | 0 .../lodash/fp/symmetricDifferenceWith.js | 0 .../core}/node_modules/lodash/fp/tail.js | 0 .../core}/node_modules/lodash/fp/take.js | 0 .../core}/node_modules/lodash/fp/takeLast.js | 0 .../node_modules/lodash/fp/takeLastWhile.js | 0 .../core}/node_modules/lodash/fp/takeRight.js | 0 .../node_modules/lodash/fp/takeRightWhile.js | 0 .../core}/node_modules/lodash/fp/takeWhile.js | 0 .../core}/node_modules/lodash/fp/tap.js | 0 .../core}/node_modules/lodash/fp/template.js | 0 .../lodash/fp/templateSettings.js | 0 .../core}/node_modules/lodash/fp/throttle.js | 0 .../core}/node_modules/lodash/fp/thru.js | 0 .../core}/node_modules/lodash/fp/times.js | 0 .../core}/node_modules/lodash/fp/toArray.js | 0 .../core}/node_modules/lodash/fp/toFinite.js | 0 .../core}/node_modules/lodash/fp/toInteger.js | 0 .../node_modules/lodash/fp/toIterator.js | 0 .../core}/node_modules/lodash/fp/toJSON.js | 0 .../core}/node_modules/lodash/fp/toLength.js | 0 .../core}/node_modules/lodash/fp/toLower.js | 0 .../core}/node_modules/lodash/fp/toNumber.js | 0 .../core}/node_modules/lodash/fp/toPairs.js | 0 .../core}/node_modules/lodash/fp/toPairsIn.js | 0 .../core}/node_modules/lodash/fp/toPath.js | 0 .../node_modules/lodash/fp/toPlainObject.js | 0 .../node_modules/lodash/fp/toSafeInteger.js | 0 .../core}/node_modules/lodash/fp/toString.js | 0 .../core}/node_modules/lodash/fp/toUpper.js | 0 .../core}/node_modules/lodash/fp/transform.js | 0 .../core}/node_modules/lodash/fp/trim.js | 0 .../core}/node_modules/lodash/fp/trimChars.js | 0 .../node_modules/lodash/fp/trimCharsEnd.js | 0 .../node_modules/lodash/fp/trimCharsStart.js | 0 .../core}/node_modules/lodash/fp/trimEnd.js | 0 .../core}/node_modules/lodash/fp/trimStart.js | 0 .../core}/node_modules/lodash/fp/truncate.js | 0 .../core}/node_modules/lodash/fp/unapply.js | 0 .../core}/node_modules/lodash/fp/unary.js | 0 .../core}/node_modules/lodash/fp/unescape.js | 0 .../core}/node_modules/lodash/fp/union.js | 0 .../core}/node_modules/lodash/fp/unionBy.js | 0 .../core}/node_modules/lodash/fp/unionWith.js | 0 .../core}/node_modules/lodash/fp/uniq.js | 0 .../core}/node_modules/lodash/fp/uniqBy.js | 0 .../core}/node_modules/lodash/fp/uniqWith.js | 0 .../core}/node_modules/lodash/fp/uniqueId.js | 0 .../core}/node_modules/lodash/fp/unnest.js | 0 .../core}/node_modules/lodash/fp/unset.js | 0 .../core}/node_modules/lodash/fp/unzip.js | 0 .../core}/node_modules/lodash/fp/unzipWith.js | 0 .../core}/node_modules/lodash/fp/update.js | 0 .../node_modules/lodash/fp/updateWith.js | 0 .../core}/node_modules/lodash/fp/upperCase.js | 0 .../node_modules/lodash/fp/upperFirst.js | 0 .../core}/node_modules/lodash/fp/useWith.js | 0 .../core}/node_modules/lodash/fp/util.js | 0 .../core}/node_modules/lodash/fp/value.js | 0 .../core}/node_modules/lodash/fp/valueOf.js | 0 .../core}/node_modules/lodash/fp/values.js | 0 .../core}/node_modules/lodash/fp/valuesIn.js | 0 .../core}/node_modules/lodash/fp/where.js | 0 .../core}/node_modules/lodash/fp/whereEq.js | 0 .../core}/node_modules/lodash/fp/without.js | 0 .../core}/node_modules/lodash/fp/words.js | 0 .../core}/node_modules/lodash/fp/wrap.js | 0 .../core}/node_modules/lodash/fp/wrapperAt.js | 0 .../node_modules/lodash/fp/wrapperChain.js | 0 .../node_modules/lodash/fp/wrapperLodash.js | 0 .../node_modules/lodash/fp/wrapperReverse.js | 0 .../node_modules/lodash/fp/wrapperValue.js | 0 .../core}/node_modules/lodash/fp/xor.js | 0 .../core}/node_modules/lodash/fp/xorBy.js | 0 .../core}/node_modules/lodash/fp/xorWith.js | 0 .../core}/node_modules/lodash/fp/zip.js | 0 .../core}/node_modules/lodash/fp/zipAll.js | 0 .../core}/node_modules/lodash/fp/zipObj.js | 0 .../core}/node_modules/lodash/fp/zipObject.js | 0 .../node_modules/lodash/fp/zipObjectDeep.js | 0 .../core}/node_modules/lodash/fp/zipWith.js | 0 .../core}/node_modules/lodash/fromPairs.js | 0 .../core}/node_modules/lodash/function.js | 0 .../core}/node_modules/lodash/functions.js | 0 .../core}/node_modules/lodash/functionsIn.js | 0 .../core}/node_modules/lodash/get.js | 0 .../core}/node_modules/lodash/groupBy.js | 0 .../core}/node_modules/lodash/gt.js | 0 .../core}/node_modules/lodash/gte.js | 0 .../core}/node_modules/lodash/has.js | 0 .../core}/node_modules/lodash/hasIn.js | 0 .../core}/node_modules/lodash/head.js | 0 .../core}/node_modules/lodash/identity.js | 0 .../core}/node_modules/lodash/inRange.js | 0 .../core}/node_modules/lodash/includes.js | 0 .../core}/node_modules/lodash/index.js | 0 .../core}/node_modules/lodash/indexOf.js | 0 .../core}/node_modules/lodash/initial.js | 0 .../core}/node_modules/lodash/intersection.js | 0 .../node_modules/lodash/intersectionBy.js | 0 .../node_modules/lodash/intersectionWith.js | 0 .../core}/node_modules/lodash/invert.js | 0 .../core}/node_modules/lodash/invertBy.js | 0 .../core}/node_modules/lodash/invoke.js | 0 .../core}/node_modules/lodash/invokeMap.js | 0 .../core}/node_modules/lodash/isArguments.js | 0 .../core}/node_modules/lodash/isArray.js | 0 .../node_modules/lodash/isArrayBuffer.js | 0 .../core}/node_modules/lodash/isArrayLike.js | 0 .../node_modules/lodash/isArrayLikeObject.js | 0 .../core}/node_modules/lodash/isBoolean.js | 0 .../core}/node_modules/lodash/isBuffer.js | 0 .../core}/node_modules/lodash/isDate.js | 0 .../core}/node_modules/lodash/isElement.js | 0 .../core}/node_modules/lodash/isEmpty.js | 0 .../core}/node_modules/lodash/isEqual.js | 0 .../core}/node_modules/lodash/isEqualWith.js | 0 .../core}/node_modules/lodash/isError.js | 0 .../core}/node_modules/lodash/isFinite.js | 0 .../core}/node_modules/lodash/isFunction.js | 0 .../core}/node_modules/lodash/isInteger.js | 0 .../core}/node_modules/lodash/isLength.js | 0 .../core}/node_modules/lodash/isMap.js | 0 .../core}/node_modules/lodash/isMatch.js | 0 .../core}/node_modules/lodash/isMatchWith.js | 0 .../core}/node_modules/lodash/isNaN.js | 0 .../core}/node_modules/lodash/isNative.js | 0 .../core}/node_modules/lodash/isNil.js | 0 .../core}/node_modules/lodash/isNull.js | 0 .../core}/node_modules/lodash/isNumber.js | 0 .../core}/node_modules/lodash/isObject.js | 0 .../core}/node_modules/lodash/isObjectLike.js | 0 .../node_modules/lodash/isPlainObject.js | 0 .../core}/node_modules/lodash/isRegExp.js | 0 .../node_modules/lodash/isSafeInteger.js | 0 .../core}/node_modules/lodash/isSet.js | 0 .../core}/node_modules/lodash/isString.js | 0 .../core}/node_modules/lodash/isSymbol.js | 0 .../core}/node_modules/lodash/isTypedArray.js | 0 .../core}/node_modules/lodash/isUndefined.js | 0 .../core}/node_modules/lodash/isWeakMap.js | 0 .../core}/node_modules/lodash/isWeakSet.js | 0 .../core}/node_modules/lodash/iteratee.js | 0 .../core}/node_modules/lodash/join.js | 0 .../core}/node_modules/lodash/kebabCase.js | 0 .../core}/node_modules/lodash/keyBy.js | 0 .../core}/node_modules/lodash/keys.js | 0 .../core}/node_modules/lodash/keysIn.js | 0 .../core}/node_modules/lodash/lang.js | 0 .../core}/node_modules/lodash/last.js | 0 .../core}/node_modules/lodash/lastIndexOf.js | 0 .../core}/node_modules/lodash/lodash.js | 93 +- .../core/node_modules/lodash/lodash.min.js | 139 + .../core}/node_modules/lodash/lowerCase.js | 0 .../core}/node_modules/lodash/lowerFirst.js | 0 .../core}/node_modules/lodash/lt.js | 0 .../core}/node_modules/lodash/lte.js | 0 .../core}/node_modules/lodash/map.js | 0 .../core}/node_modules/lodash/mapKeys.js | 0 .../core}/node_modules/lodash/mapValues.js | 0 .../core}/node_modules/lodash/matches.js | 7 + .../node_modules/lodash/matchesProperty.js | 7 + .../core}/node_modules/lodash/math.js | 0 .../core}/node_modules/lodash/max.js | 0 .../core}/node_modules/lodash/maxBy.js | 0 .../core}/node_modules/lodash/mean.js | 0 .../core}/node_modules/lodash/meanBy.js | 0 .../core}/node_modules/lodash/memoize.js | 0 .../core}/node_modules/lodash/merge.js | 0 .../core}/node_modules/lodash/mergeWith.js | 0 .../core}/node_modules/lodash/method.js | 0 .../core}/node_modules/lodash/methodOf.js | 0 .../core}/node_modules/lodash/min.js | 0 .../core}/node_modules/lodash/minBy.js | 0 .../core}/node_modules/lodash/mixin.js | 0 .../core}/node_modules/lodash/multiply.js | 0 .../core}/node_modules/lodash/negate.js | 0 .../core}/node_modules/lodash/next.js | 0 .../core}/node_modules/lodash/noop.js | 0 .../core}/node_modules/lodash/now.js | 0 .../core}/node_modules/lodash/nth.js | 0 .../core}/node_modules/lodash/nthArg.js | 0 .../core}/node_modules/lodash/number.js | 0 .../core}/node_modules/lodash/object.js | 0 .../core}/node_modules/lodash/omit.js | 0 .../core}/node_modules/lodash/omitBy.js | 0 .../core}/node_modules/lodash/once.js | 0 .../core}/node_modules/lodash/orderBy.js | 0 .../core}/node_modules/lodash/over.js | 0 .../core}/node_modules/lodash/overArgs.js | 0 .../core}/node_modules/lodash/overEvery.js | 4 + .../core}/node_modules/lodash/overSome.js | 7 + .../core/node_modules/lodash/package.json | 17 + .../core}/node_modules/lodash/pad.js | 0 .../core}/node_modules/lodash/padEnd.js | 0 .../core}/node_modules/lodash/padStart.js | 0 .../core}/node_modules/lodash/parseInt.js | 0 .../core}/node_modules/lodash/partial.js | 0 .../core}/node_modules/lodash/partialRight.js | 0 .../core}/node_modules/lodash/partition.js | 0 .../core}/node_modules/lodash/pick.js | 0 .../core}/node_modules/lodash/pickBy.js | 0 .../core}/node_modules/lodash/plant.js | 0 .../core}/node_modules/lodash/property.js | 0 .../core}/node_modules/lodash/propertyOf.js | 0 .../core}/node_modules/lodash/pull.js | 0 .../core}/node_modules/lodash/pullAll.js | 0 .../core}/node_modules/lodash/pullAllBy.js | 0 .../core}/node_modules/lodash/pullAllWith.js | 0 .../core}/node_modules/lodash/pullAt.js | 0 .../core}/node_modules/lodash/random.js | 0 .../core}/node_modules/lodash/range.js | 0 .../core}/node_modules/lodash/rangeRight.js | 0 .../core}/node_modules/lodash/rearg.js | 0 .../core}/node_modules/lodash/reduce.js | 0 .../core}/node_modules/lodash/reduceRight.js | 0 .../core}/node_modules/lodash/reject.js | 0 .../core}/node_modules/lodash/remove.js | 0 .../core}/node_modules/lodash/repeat.js | 0 .../core}/node_modules/lodash/replace.js | 0 .../core}/node_modules/lodash/rest.js | 0 .../core}/node_modules/lodash/result.js | 0 .../core}/node_modules/lodash/reverse.js | 0 .../core}/node_modules/lodash/round.js | 0 .../core}/node_modules/lodash/sample.js | 0 .../core}/node_modules/lodash/sampleSize.js | 0 .../core}/node_modules/lodash/seq.js | 0 .../core}/node_modules/lodash/set.js | 0 .../core}/node_modules/lodash/setWith.js | 0 .../core}/node_modules/lodash/shuffle.js | 0 .../core}/node_modules/lodash/size.js | 0 .../core}/node_modules/lodash/slice.js | 0 .../core}/node_modules/lodash/snakeCase.js | 0 .../core}/node_modules/lodash/some.js | 0 .../core}/node_modules/lodash/sortBy.js | 6 +- .../core}/node_modules/lodash/sortedIndex.js | 0 .../node_modules/lodash/sortedIndexBy.js | 0 .../node_modules/lodash/sortedIndexOf.js | 0 .../node_modules/lodash/sortedLastIndex.js | 0 .../node_modules/lodash/sortedLastIndexBy.js | 0 .../node_modules/lodash/sortedLastIndexOf.js | 0 .../core}/node_modules/lodash/sortedUniq.js | 0 .../core}/node_modules/lodash/sortedUniqBy.js | 0 .../core}/node_modules/lodash/split.js | 0 .../core}/node_modules/lodash/spread.js | 0 .../core}/node_modules/lodash/startCase.js | 0 .../core}/node_modules/lodash/startsWith.js | 0 .../core}/node_modules/lodash/string.js | 0 .../core}/node_modules/lodash/stubArray.js | 0 .../core}/node_modules/lodash/stubFalse.js | 0 .../core}/node_modules/lodash/stubObject.js | 0 .../core}/node_modules/lodash/stubString.js | 0 .../core}/node_modules/lodash/stubTrue.js | 0 .../core}/node_modules/lodash/subtract.js | 0 .../core}/node_modules/lodash/sum.js | 0 .../core}/node_modules/lodash/sumBy.js | 0 .../core}/node_modules/lodash/tail.js | 0 .../core}/node_modules/lodash/take.js | 0 .../core}/node_modules/lodash/takeRight.js | 0 .../node_modules/lodash/takeRightWhile.js | 0 .../core}/node_modules/lodash/takeWhile.js | 0 .../core}/node_modules/lodash/tap.js | 0 .../core}/node_modules/lodash/template.js | 8 +- .../node_modules/lodash/templateSettings.js | 0 .../core}/node_modules/lodash/throttle.js | 0 .../core}/node_modules/lodash/thru.js | 0 .../core}/node_modules/lodash/times.js | 0 .../core}/node_modules/lodash/toArray.js | 0 .../core}/node_modules/lodash/toFinite.js | 0 .../core}/node_modules/lodash/toInteger.js | 0 .../core}/node_modules/lodash/toIterator.js | 0 .../core}/node_modules/lodash/toJSON.js | 0 .../core}/node_modules/lodash/toLength.js | 0 .../core}/node_modules/lodash/toLower.js | 0 .../core}/node_modules/lodash/toNumber.js | 0 .../core}/node_modules/lodash/toPairs.js | 0 .../core}/node_modules/lodash/toPairsIn.js | 0 .../core}/node_modules/lodash/toPath.js | 0 .../node_modules/lodash/toPlainObject.js | 0 .../node_modules/lodash/toSafeInteger.js | 0 .../core}/node_modules/lodash/toString.js | 0 .../core}/node_modules/lodash/toUpper.js | 0 .../core}/node_modules/lodash/transform.js | 0 .../core}/node_modules/lodash/trim.js | 0 .../core}/node_modules/lodash/trimEnd.js | 0 .../core}/node_modules/lodash/trimStart.js | 0 .../core}/node_modules/lodash/truncate.js | 0 .../core}/node_modules/lodash/unary.js | 0 .../core}/node_modules/lodash/unescape.js | 0 .../core}/node_modules/lodash/union.js | 0 .../core}/node_modules/lodash/unionBy.js | 0 .../core}/node_modules/lodash/unionWith.js | 0 .../core}/node_modules/lodash/uniq.js | 0 .../core}/node_modules/lodash/uniqBy.js | 0 .../core}/node_modules/lodash/uniqWith.js | 0 .../core}/node_modules/lodash/uniqueId.js | 0 .../core}/node_modules/lodash/unset.js | 0 .../core}/node_modules/lodash/unzip.js | 0 .../core}/node_modules/lodash/unzipWith.js | 0 .../core}/node_modules/lodash/update.js | 0 .../core}/node_modules/lodash/updateWith.js | 0 .../core}/node_modules/lodash/upperCase.js | 0 .../core}/node_modules/lodash/upperFirst.js | 0 .../core}/node_modules/lodash/util.js | 0 .../core}/node_modules/lodash/value.js | 0 .../core}/node_modules/lodash/valueOf.js | 0 .../core}/node_modules/lodash/values.js | 0 .../core}/node_modules/lodash/valuesIn.js | 0 .../core}/node_modules/lodash/without.js | 0 .../core}/node_modules/lodash/words.js | 0 .../core}/node_modules/lodash/wrap.js | 0 .../core}/node_modules/lodash/wrapperAt.js | 0 .../core}/node_modules/lodash/wrapperChain.js | 0 .../node_modules/lodash/wrapperLodash.js | 0 .../node_modules/lodash/wrapperReverse.js | 0 .../core}/node_modules/lodash/wrapperValue.js | 0 .../core}/node_modules/lodash/xor.js | 0 .../core}/node_modules/lodash/xorBy.js | 0 .../core}/node_modules/lodash/xorWith.js | 0 .../core}/node_modules/lodash/zip.js | 0 .../core}/node_modules/lodash/zipObject.js | 0 .../node_modules/lodash/zipObjectDeep.js | 0 .../core}/node_modules/lodash/zipWith.js | 0 .../@babel/core/node_modules/minimist/LICENSE | 18 + .../core/node_modules/minimist/index.js | 245 + .../core/node_modules/minimist/package.json | 45 + .../node_modules/minimist/readme.markdown | 95 + .../core}/node_modules/ms/index.js | 0 .../core}/node_modules/ms/license.md | 0 .../core}/node_modules/ms/package.json | 49 +- .../core}/node_modules/ms/readme.md | 0 .../core}/node_modules/path-parse/LICENSE | 0 .../core}/node_modules/path-parse/README.md | 0 .../core}/node_modules/path-parse/index.js | 0 .../node_modules/path-parse/package.json | 33 +- .../core}/node_modules/resolve/LICENSE | 0 .../@babel/core/node_modules/resolve/index.js | 6 + .../core}/node_modules/resolve/lib/async.js | 152 +- .../core}/node_modules/resolve/lib/caller.js | 0 .../core}/node_modules/resolve/lib/core.js | 4 +- .../core}/node_modules/resolve/lib/core.json | 12 +- .../core/node_modules/resolve/lib/is-core.js | 5 + .../resolve/lib/node-modules-paths.js | 0 .../resolve/lib/normalize-options.js | 0 .../core}/node_modules/resolve/lib/sync.js | 80 +- .../core/node_modules/resolve/package.json | 51 + .../node_modules/resolve/readme.markdown | 61 +- .../core/node_modules/safe-buffer/LICENSE} | 2 +- .../core/node_modules/safe-buffer/README.md | 584 ++ .../core/node_modules/safe-buffer/index.js | 62 + .../node_modules/safe-buffer/package.json | 37 + .../@babel/core/node_modules/semver/LICENSE | 15 + .../@babel/core/node_modules/semver/README.md | 412 + .../core/node_modules/semver/bin/semver | 160 + .../core/node_modules/semver/package.json | 28 + .../@babel/core/node_modules/semver/range.bnf | 16 + .../@babel/core/node_modules/semver/semver.js | 1483 +++ .../core}/node_modules/source-map/LICENSE | 0 .../core}/node_modules/source-map/README.md | 0 .../source-map/dist/source-map.debug.js | 0 .../source-map/dist/source-map.js | 0 .../source-map/dist/source-map.min.js | 0 .../node_modules/source-map/lib/array-set.js | 0 .../node_modules/source-map/lib/base64-vlq.js | 0 .../node_modules/source-map/lib/base64.js | 0 .../source-map/lib/binary-search.js | 0 .../source-map/lib/mapping-list.js | 0 .../node_modules/source-map/lib/quick-sort.js | 0 .../source-map/lib/source-map-consumer.js | 0 .../source-map/lib/source-map-generator.js | 0 .../source-map/lib/source-node.js | 0 .../core}/node_modules/source-map/lib/util.js | 0 .../core/node_modules/source-map/package.json | 72 + .../node_modules/source-map/source-map.js | 0 .../node_modules/supports-color/browser.js | 0 .../node_modules/supports-color/index.js | 0 .../core}/node_modules/supports-color/license | 0 .../node_modules/supports-color/package.json | 53 + .../node_modules/supports-color/readme.md | 0 .../node_modules/to-fast-properties/index.js | 0 .../node_modules/to-fast-properties/license | 0 .../to-fast-properties/package.json | 33 +- .../node_modules/to-fast-properties/readme.md | 0 tools/node_modules/@babel/core/package.json | 66 + .../core/src/config/files/index-browser.js | 96 + .../@babel/core/src/config/files/index.js | 31 + .../@babel/core/src/transform-file-browser.js | 29 + .../@babel/core/src/transform-file.js | 40 + .../node_modules/@babel/eslint-parser/LICENSE | 22 + .../@babel/eslint-parser/README.md | 124 + .../eslint-parser}/lib/analyze-scope.js | 212 +- .../@babel/eslint-parser/lib/configuration.js | 66 + .../eslint-parser/lib/convert/convertAST.js | 158 + .../lib/convert}/convertComments.js | 15 +- .../lib/convert/convertTokens.js | 150 + .../@babel/eslint-parser/lib/convert/index.js | 20 + .../@babel/eslint-parser/lib/index.js | 68 + .../@babel/eslint-parser/lib/visitor-keys.js | 28 + .../node_modules/eslint-scope/LICENSE | 22 + .../node_modules/eslint-scope/README.md | 54 + .../eslint-scope/lib/definition.js | 86 + .../node_modules/eslint-scope/lib/index.js | 165 + .../eslint-scope/lib/pattern-visitor.js | 152 + .../eslint-scope/lib/reference.js | 167 + .../eslint-scope/lib/referencer.js | 629 ++ .../eslint-scope/lib/scope-manager.js | 247 + .../node_modules/eslint-scope/lib/scope.js | 748 ++ .../node_modules/eslint-scope/lib/variable.js | 88 + .../node_modules/eslint-scope/package.json | 48 + .../node_modules/eslint-visitor-keys/LICENSE | 0 .../eslint-visitor-keys/README.md | 0 .../eslint-visitor-keys/lib/index.js | 0 .../eslint-visitor-keys/lib/visitor-keys.json | 4 + .../eslint-visitor-keys/package.json | 54 +- .../node_modules/esrecurse/README.md | 171 + .../node_modules/esrecurse/esrecurse.js | 117 + .../node_modules/estraverse}/LICENSE.BSD | 0 .../node_modules/estraverse/README.md | 153 + .../node_modules/estraverse/estraverse.js | 801 ++ .../node_modules/estraverse/package.json | 40 + .../node_modules/esrecurse/package.json | 52 + .../node_modules/estraverse/LICENSE.BSD | 19 + .../node_modules/estraverse/README.md | 153 + .../node_modules/estraverse/estraverse.js | 782 ++ .../node_modules/estraverse/package.json | 40 + .../eslint-parser/node_modules/semver/LICENSE | 15 + .../node_modules/semver/README.md | 443 + .../node_modules/semver/bin/semver.js | 174 + .../node_modules/semver/package.json | 28 + .../node_modules/semver/range.bnf | 16 + .../node_modules/semver/semver.js | 1596 +++ .../@babel/eslint-parser/package.json | 43 + .../plugin-syntax-class-properties/LICENSE | 22 + .../plugin-syntax-class-properties/README.md | 19 + .../lib/index.js | 22 + .../@babel/helper-plugin-utils/LICENSE | 22 + .../@babel/helper-plugin-utils/README.md | 19 + .../@babel/helper-plugin-utils/lib/index.js | 77 + .../@babel/helper-plugin-utils/package.json | 18 + .../package.json | 27 + tools/node_modules/babel-eslint/README.md | 103 - .../lib/babylon-to-espree/attachComments.js | 59 - .../babylon-to-espree/convertTemplateType.js | 92 - .../lib/babylon-to-espree/index.js | 30 - .../lib/babylon-to-espree/toAST.js | 118 - .../lib/babylon-to-espree/toToken.js | 84 - .../lib/babylon-to-espree/toTokens.js | 10 - tools/node_modules/babel-eslint/lib/index.js | 19 - .../babel-eslint/lib/parse-with-scope.js | 12 - tools/node_modules/babel-eslint/lib/parse.js | 93 - .../babel-eslint/lib/require-from-eslint.js | 9 - .../babel-eslint/lib/visitor-keys.js | 15 - .../node_modules/@babel/generator/README.md | 19 - .../@babel/generator/lib/node/parentheses.js | 253 - .../@babel/generator/package.json | 36 - .../@babel/helper-function-name/package.json | 21 - .../helper-get-function-arity/lib/index.js | 32 - .../helper-get-function-arity/package.json | 16 - .../package.json | 20 - .../node_modules/@babel/parser/README.md | 19 - .../node_modules/@babel/template/README.md | 19 - .../node_modules/@babel/template/package.json | 27 - .../@babel/traverse/lib/path/comments.js | 47 - .../traverse/lib/path/inference/index.js | 132 - .../node_modules/@babel/traverse/package.json | 36 - .../node_modules/@babel/types/README.md | 19 - .../types/lib/builders/generated/index.js | 1148 --- .../@babel/types/lib/clone/cloneNode.js | 78 - .../@babel/types/lib/definitions/core.js | 725 -- .../@babel/types/lib/definitions/es2015.js | 401 - .../@babel/types/lib/definitions/misc.js | 23 - .../@babel/types/lib/utils/inherit.js | 24 - .../@babel/types/lib/validators/isScope.js | 24 - .../types/lib/validators/isValidIdentifier.js | 28 - .../node_modules/@babel/types/package.json | 29 - .../@babel/types/scripts/generators/flow.js | 153 - .../types/scripts/generators/typescript.js | 200 - .../node_modules/ansi-styles/package.json | 65 - .../node_modules/chalk/package.json | 80 - .../node_modules/debug/dist/debug.js | 912 -- .../node_modules/debug/package.json | 79 - .../escape-string-regexp/package.json | 58 - .../node_modules/esutils/README.md | 174 - .../node_modules/esutils/lib/ast.js | 144 - .../node_modules/esutils/lib/code.js | 135 - .../node_modules/esutils/lib/keyword.js | 165 - .../node_modules/esutils/lib/utils.js | 33 - .../node_modules/esutils/package.json | 49 - .../node_modules/globals/package.json | 50 - .../node_modules/lodash/core.min.js | 29 - .../node_modules/lodash/lodash.min.js | 137 - .../node_modules/lodash/package.json | 40 - .../node_modules/resolve/index.js | 8 - .../node_modules/resolve/package.json | 49 - .../node_modules/source-map/package.json | 188 - .../node_modules/supports-color/package.json | 62 - .../node_modules/trim-right/index.js | 10 - .../node_modules/trim-right/package.json | 46 - .../node_modules/trim-right/readme.md | 30 - tools/node_modules/babel-eslint/package.json | 67 - tools/update-babel-eslint.sh | 14 +- 1589 files changed, 44091 insertions(+), 12697 deletions(-) rename tools/node_modules/{babel-eslint/node_modules/@babel/code-frame => @babel/core}/LICENSE (100%) create mode 100644 tools/node_modules/@babel/core/README.md create mode 100644 tools/node_modules/@babel/core/lib/config/caching.js create mode 100644 tools/node_modules/@babel/core/lib/config/config-chain.js create mode 100644 tools/node_modules/@babel/core/lib/config/config-descriptors.js create mode 100644 tools/node_modules/@babel/core/lib/config/files/configuration.js create mode 100644 tools/node_modules/@babel/core/lib/config/files/import.js create mode 100644 tools/node_modules/@babel/core/lib/config/files/index-browser.js create mode 100644 tools/node_modules/@babel/core/lib/config/files/index.js create mode 100644 tools/node_modules/@babel/core/lib/config/files/module-types.js create mode 100644 tools/node_modules/@babel/core/lib/config/files/package.js create mode 100644 tools/node_modules/@babel/core/lib/config/files/plugins.js create mode 100644 tools/node_modules/@babel/core/lib/config/files/types.js create mode 100644 tools/node_modules/@babel/core/lib/config/files/utils.js create mode 100644 tools/node_modules/@babel/core/lib/config/full.js create mode 100644 tools/node_modules/@babel/core/lib/config/helpers/config-api.js create mode 100644 tools/node_modules/@babel/core/lib/config/helpers/environment.js create mode 100644 tools/node_modules/@babel/core/lib/config/index.js create mode 100644 tools/node_modules/@babel/core/lib/config/item.js create mode 100644 tools/node_modules/@babel/core/lib/config/partial.js create mode 100644 tools/node_modules/@babel/core/lib/config/pattern-to-regex.js create mode 100644 tools/node_modules/@babel/core/lib/config/plugin.js create mode 100644 tools/node_modules/@babel/core/lib/config/printer.js create mode 100644 tools/node_modules/@babel/core/lib/config/util.js create mode 100644 tools/node_modules/@babel/core/lib/config/validation/option-assertions.js create mode 100644 tools/node_modules/@babel/core/lib/config/validation/options.js create mode 100644 tools/node_modules/@babel/core/lib/config/validation/plugins.js create mode 100644 tools/node_modules/@babel/core/lib/config/validation/removed.js create mode 100644 tools/node_modules/@babel/core/lib/gensync-utils/async.js create mode 100644 tools/node_modules/@babel/core/lib/gensync-utils/fs.js create mode 100644 tools/node_modules/@babel/core/lib/gensync-utils/resolve.js create mode 100644 tools/node_modules/@babel/core/lib/index.js create mode 100644 tools/node_modules/@babel/core/lib/parse.js create mode 100644 tools/node_modules/@babel/core/lib/parser/index.js create mode 100644 tools/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js create mode 100644 tools/node_modules/@babel/core/lib/tools/build-external-helpers.js create mode 100644 tools/node_modules/@babel/core/lib/transform-ast.js create mode 100644 tools/node_modules/@babel/core/lib/transform-file-browser.js create mode 100644 tools/node_modules/@babel/core/lib/transform-file.js create mode 100644 tools/node_modules/@babel/core/lib/transform.js create mode 100644 tools/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js create mode 100644 tools/node_modules/@babel/core/lib/transformation/file/file.js create mode 100644 tools/node_modules/@babel/core/lib/transformation/file/generate.js create mode 100644 tools/node_modules/@babel/core/lib/transformation/file/merge-map.js create mode 100644 tools/node_modules/@babel/core/lib/transformation/index.js create mode 100644 tools/node_modules/@babel/core/lib/transformation/normalize-file.js create mode 100644 tools/node_modules/@babel/core/lib/transformation/normalize-opts.js create mode 100644 tools/node_modules/@babel/core/lib/transformation/plugin-pass.js rename tools/node_modules/{babel-eslint/node_modules/@babel/generator => @babel/core/node_modules/@babel/code-frame}/LICENSE (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/code-frame/README.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/code-frame/lib/index.js (80%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/code-frame/package.json (54%) rename tools/node_modules/{babel-eslint/node_modules/@babel/helper-split-export-declaration => @babel/core/node_modules/@babel/generator}/LICENSE (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/generator/README.md rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/buffer.js (83%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/base.js (94%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/classes.js (64%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/expressions.js (80%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/flow.js (78%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/index.js (81%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/jsx.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/methods.js (71%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/modules.js (68%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/statements.js (84%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/template-literals.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/types.js (52%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/generators/typescript.js (91%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/index.js (95%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/node/index.js (65%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/generator/lib/node/parentheses.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/node/whitespace.js (53%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/printer.js (74%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/generator/lib/source-map.js (74%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/generator/package.json rename tools/node_modules/{babel-eslint/node_modules/@babel/highlight => @babel/core/node_modules/@babel/helper-function-name}/LICENSE (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/helper-function-name/README.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/helper-function-name/lib/index.js (62%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-function-name/package.json rename tools/node_modules/{babel-eslint/node_modules/@babel/template => @babel/core/node_modules/@babel/helper-get-function-arity}/LICENSE (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/helper-get-function-arity/README.md (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/lib/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/package.json rename tools/node_modules/{babel-eslint/node_modules/@babel/traverse => @babel/core/node_modules/@babel/helper-member-expression-to-functions}/LICENSE (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/lib/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/package.json rename tools/node_modules/{babel-eslint/node_modules/@babel/types => @babel/core/node_modules/@babel/helper-module-imports}/LICENSE (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/import-builder.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/import-injector.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/is-module.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/package.json rename tools/node_modules/{babel-eslint => @babel/core/node_modules/@babel/helper-module-transforms}/LICENSE (93%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/get-module-name.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/package.json rename tools/node_modules/{babel-eslint/node_modules/@babel/helper-get-function-arity => @babel/core/node_modules/@babel/helper-optimise-call-expression}/LICENSE (93%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/lib/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/package.json rename tools/node_modules/{babel-eslint/node_modules/@babel/helper-function-name => @babel/core/node_modules/@babel/helper-replace-supers}/LICENSE (93%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/lib/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/LICENSE create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/lib/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/LICENSE rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/helper-split-export-declaration/README.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/helper-split-export-declaration/lib/index.js (55%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/LICENSE create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/identifier.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/keyword.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helpers/LICENSE create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helpers/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helpers/lib/helpers.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helpers/lib/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/helpers/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/highlight/LICENSE rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/highlight/README.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/highlight/lib/index.js (57%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/highlight/package.json (57%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/parser/LICENSE (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/parser/README.md rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/parser/bin/babel-parser.js (57%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/parser/lib/index.js (52%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/parser/package.json (50%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/template/LICENSE create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/template/README.md rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/template/lib/builder.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/template/lib/formatters.js (51%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/template/lib/index.js (56%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/template/lib/literal.js (93%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/template/lib/options.js (97%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/template/lib/parse.js (58%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/template/lib/populate.js (62%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/template/lib/string.js (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/template/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/traverse/LICENSE rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/README.md (51%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/cache.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/context.js (70%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/hub.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/index.js (63%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/ancestry.js (79%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/comments.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/context.js (86%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/conversion.js (62%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/evaluation.js (97%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/family.js (60%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/index.js (58%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/inference/index.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js (68%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/inference/inferers.js (53%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/introspection.js (62%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/lib/hoister.js (74%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/lib/virtual-types.js (65%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/modification.js (79%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/removal.js (79%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/path/replacement.js (64%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/scope/binding.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/scope/index.js (64%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/scope/lib/renamer.js (62%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/traverse/lib/visitors.js (80%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/traverse/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/LICENSE create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/README.md rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/asserts/assertNode.js (75%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/asserts/generated/index.js (92%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/builders/builder.js (80%) rename tools/node_modules/{babel-eslint/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js => @babel/core/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js} (85%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/generated/index.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/builders/react/buildChildren.js (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/clone/clone.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/clone/cloneDeep.js (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneNode.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js (63%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/comments/addComment.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/comments/addComments.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/comments/inheritInnerComments.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/comments/inheritLeadingComments.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/comments/inheritTrailingComments.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/comments/inheritsComments.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/comments/removeComments.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/constants/generated/index.js (75%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/constants/index.js (81%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/converters/ensureBlock.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js (92%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/converters/toBlock.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/converters/toComputedKey.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/converters/toExpression.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/converters/toIdentifier.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/converters/toKeyAlias.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/converters/toSequenceExpression.js (91%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/converters/toStatement.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/converters/valueToNode.js (83%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/core.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/definitions/experimental.js (59%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/definitions/flow.js (82%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/definitions/index.js (72%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/definitions/jsx.js (80%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/misc.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/definitions/placeholders.js (92%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/definitions/typescript.js (84%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/definitions/utils.js (65%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/index.js (92%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/index.js.flow (69%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/modifications/inherits.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/modifications/removeProperties.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/traverse/traverse.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/traverse/traverseFast.js (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/lib/utils/inherit.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/utils/shallowEqual.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/generated/index.js (88%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/is.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isBinding.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isBlockScoped.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isImmutable.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isLet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isNode.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isNodesEquivalent.js (92%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isPlaceholderType.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isReferenced.js (96%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isScope.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isSpecifierDefault.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isType.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isValidES3Identifier.js (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isValidIdentifier.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/isVar.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/matchesPattern.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/react/isCompatTag.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/react/isReactComponent.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/lib/validators/validate.js (62%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/scripts/generateTypeHelpers.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/scripts/generators/docs.js (89%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/flow.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/scripts/generators/generateAsserts.js (89%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/scripts/generators/generateBuilders.js (57%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/scripts/generators/generateConstants.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/scripts/generators/generateValidators.js (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/typescript.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/scripts/utils/formatBuilderName.js (62%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/scripts/utils/lowerFirst.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/scripts/utils/stringifyValidator.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/@babel/types/scripts/utils/toFunctionName.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/ansi-styles/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/ansi-styles/license (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/ansi-styles/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/ansi-styles/readme.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/chalk/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/chalk/index.js.flow (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/chalk/license (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/chalk/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/chalk/readme.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/chalk/templates.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/color-convert/LICENSE (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/color-convert/README.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/color-convert/conversions.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/color-convert/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/color-convert/package.json (65%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/color-convert/route.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/color-name/LICENSE (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/color-name/README.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/color-name/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/color-name/package.json (58%) create mode 100644 tools/node_modules/@babel/core/node_modules/convert-source-map/LICENSE create mode 100644 tools/node_modules/@babel/core/node_modules/convert-source-map/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/convert-source-map/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/convert-source-map/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/debug/LICENSE (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/debug/README.md (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/debug/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/debug/src/browser.js (91%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/debug/src/common.js (87%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/debug/src/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/debug/src/node.js (94%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/escape-string-regexp/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/escape-string-regexp/license (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/escape-string-regexp/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/escape-string-regexp/readme.md (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/function-bind/.jscs.json create mode 100644 tools/node_modules/@babel/core/node_modules/function-bind/LICENSE create mode 100644 tools/node_modules/@babel/core/node_modules/function-bind/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/function-bind/implementation.js create mode 100644 tools/node_modules/@babel/core/node_modules/function-bind/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/function-bind/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/gensync/LICENSE create mode 100644 tools/node_modules/@babel/core/node_modules/gensync/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/gensync/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/gensync/index.js.flow create mode 100644 tools/node_modules/@babel/core/node_modules/gensync/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/globals/globals.json (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/globals/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/globals/license (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/globals/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/globals/readme.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/has-flag/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/has-flag/license (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/has-flag/package.json (66%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/has-flag/readme.md (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/has/LICENSE-MIT create mode 100644 tools/node_modules/@babel/core/node_modules/has/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/has/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/has/src/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/is-core-module/LICENSE create mode 100644 tools/node_modules/@babel/core/node_modules/is-core-module/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/is-core-module/core.json create mode 100644 tools/node_modules/@babel/core/node_modules/is-core-module/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/is-core-module/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/js-tokens/LICENSE (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/js-tokens/README.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/js-tokens/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/js-tokens/package.json (53%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/jsesc/LICENSE-MIT.txt (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/jsesc/README.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/jsesc/bin/jsesc (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/jsesc/jsesc.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/jsesc/man/jsesc.1 (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/jsesc/package.json (79%) create mode 100644 tools/node_modules/@babel/core/node_modules/json5/LICENSE.md create mode 100644 tools/node_modules/@babel/core/node_modules/json5/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/json5/dist/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/json5/dist/index.min.js create mode 100644 tools/node_modules/@babel/core/node_modules/json5/dist/index.min.mjs create mode 100644 tools/node_modules/@babel/core/node_modules/json5/dist/index.mjs create mode 100644 tools/node_modules/@babel/core/node_modules/json5/lib/cli.js create mode 100644 tools/node_modules/@babel/core/node_modules/json5/lib/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/json5/lib/parse.js create mode 100644 tools/node_modules/@babel/core/node_modules/json5/lib/register.js create mode 100644 tools/node_modules/@babel/core/node_modules/json5/lib/require.js create mode 100644 tools/node_modules/@babel/core/node_modules/json5/lib/stringify.js create mode 100644 tools/node_modules/@babel/core/node_modules/json5/lib/unicode.js create mode 100644 tools/node_modules/@babel/core/node_modules/json5/lib/util.js create mode 100644 tools/node_modules/@babel/core/node_modules/json5/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/LICENSE (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/README.md (95%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_DataView.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_Hash.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_LazyWrapper.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_ListCache.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_LodashWrapper.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_Map.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_MapCache.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_Promise.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_Set.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_SetCache.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_Stack.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_Symbol.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_Uint8Array.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_WeakMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_apply.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayAggregator.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayEach.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayEachRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayEvery.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayFilter.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayIncludes.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayIncludesWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayLikeKeys.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayPush.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayReduce.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayReduceRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arraySample.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arraySampleSize.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arrayShuffle.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_arraySome.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_asciiSize.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_asciiToArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_asciiWords.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_assignMergeValue.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_assignValue.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_assocIndexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseAggregator.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseAssign.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseAssignIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseAssignValue.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseAt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseClamp.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseClone.js (98%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseConforms.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseConformsTo.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseCreate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseDelay.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseDifference.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseEach.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseEachRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseEvery.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseExtremum.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseFill.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseFilter.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseFindIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseFindKey.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseFlatten.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseFor.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseForOwn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseForOwnRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseForRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseFunctions.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseGet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseGetAllKeys.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseGetTag.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseGt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseHas.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseHasIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseInRange.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIndexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIndexOfWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIntersection.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseInverter.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseInvoke.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsArguments.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsArrayBuffer.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsDate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsEqual.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsEqualDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsMatch.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsNaN.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsNative.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsRegExp.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsSet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIsTypedArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseIteratee.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseKeys.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseKeysIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseLodash.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseLt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseMatches.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseMatchesProperty.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseMean.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseMerge.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseMergeDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseNth.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseOrderBy.js (68%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_basePick.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_basePickBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseProperty.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_basePropertyDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_basePropertyOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_basePullAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_basePullAt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseRandom.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseRange.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseReduce.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseRepeat.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseRest.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSample.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSampleSize.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSet.js (92%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSetData.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSetToString.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseShuffle.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSlice.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSome.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSortBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSortedIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSortedIndexBy.js (94%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSortedUniq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseSum.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseTimes.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseToNumber.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseToPairs.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseToString.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseUnary.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseUniq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseUnset.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseUpdate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseValues.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseWhile.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseWrapperValue.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseXor.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_baseZipObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_cacheHas.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_castArrayLikeObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_castFunction.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_castPath.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_castRest.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_castSlice.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_charsEndIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_charsStartIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_cloneArrayBuffer.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_cloneBuffer.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_cloneDataView.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_cloneRegExp.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_cloneSymbol.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_cloneTypedArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_compareAscending.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_compareMultiple.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_composeArgs.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_composeArgsRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_copyArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_copyObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_copySymbols.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_copySymbolsIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_coreJsData.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_countHolders.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createAggregator.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createAssigner.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createBaseEach.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createBaseFor.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createBind.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createCaseFirst.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createCompounder.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createCtor.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createCurry.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createFind.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createFlow.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createHybrid.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createInverter.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createMathOperation.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createOver.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createPadding.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createPartial.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createRange.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createRecurry.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createRelationalOperation.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createRound.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createSet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createToPairs.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_createWrap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_customDefaultsAssignIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_customDefaultsMerge.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_customOmitClone.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_deburrLetter.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_defineProperty.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_equalArrays.js (92%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_equalByTag.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_equalObjects.js (93%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_escapeHtmlChar.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_escapeStringChar.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_flatRest.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_freeGlobal.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getAllKeys.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getAllKeysIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getData.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getFuncName.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getHolder.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getMapData.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getMatchData.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getNative.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getPrototype.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getRawTag.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getSymbols.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getSymbolsIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getTag.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getValue.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getView.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_getWrapDetails.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_hasPath.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_hasUnicode.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_hasUnicodeWord.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_hashClear.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_hashDelete.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_hashGet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_hashHas.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_hashSet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_initCloneArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_initCloneByTag.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_initCloneObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_insertWrapDetails.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_isFlattenable.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_isIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_isIterateeCall.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_isKey.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_isKeyable.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_isLaziable.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_isMaskable.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_isMasked.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_isPrototype.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_isStrictComparable.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_iteratorToArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_lazyClone.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_lazyReverse.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_lazyValue.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_listCacheClear.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_listCacheDelete.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_listCacheGet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_listCacheHas.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_listCacheSet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_mapCacheClear.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_mapCacheDelete.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_mapCacheGet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_mapCacheHas.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_mapCacheSet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_mapToArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_matchesStrictComparable.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_memoizeCapped.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_mergeData.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_metaMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_nativeCreate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_nativeKeys.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_nativeKeysIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_nodeUtil.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_objectToString.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_overArg.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_overRest.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_parent.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_reEscape.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_reEvaluate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_reInterpolate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_realNames.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_reorder.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_replaceHolders.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_root.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_safeGet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_setCacheAdd.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_setCacheHas.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_setData.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_setToArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_setToPairs.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_setToString.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_setWrapToString.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_shortOut.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_shuffleSelf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_stackClear.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_stackDelete.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_stackGet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_stackHas.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_stackSet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_strictIndexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_strictLastIndexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_stringSize.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_stringToArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_stringToPath.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_toKey.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_toSource.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_unescapeHtmlChar.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_unicodeSize.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_unicodeToArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_unicodeWords.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_updateWrapDetails.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/_wrapperClone.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/add.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/after.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/array.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/ary.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/assign.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/assignIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/assignInWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/assignWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/at.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/attempt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/before.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/bind.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/bindAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/bindKey.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/camelCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/capitalize.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/castArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/ceil.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/chain.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/chunk.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/clamp.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/clone.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/cloneDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/cloneDeepWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/cloneWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/collection.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/commit.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/compact.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/concat.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/cond.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/conforms.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/conformsTo.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/constant.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/core.js (99%) create mode 100644 tools/node_modules/@babel/core/node_modules/lodash/core.min.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/countBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/create.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/curry.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/curryRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/date.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/debounce.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/deburr.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/defaultTo.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/defaults.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/defaultsDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/defer.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/delay.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/difference.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/differenceBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/differenceWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/divide.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/drop.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/dropRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/dropRightWhile.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/dropWhile.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/each.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/eachRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/endsWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/entries.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/entriesIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/eq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/escape.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/escapeRegExp.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/every.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/extend.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/extendWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fill.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/filter.js (89%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/find.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/findIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/findKey.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/findLast.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/findLastIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/findLastKey.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/first.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/flatMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/flatMapDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/flatMapDepth.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/flatten.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/flattenDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/flattenDepth.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/flip.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/floor.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/flow.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/flowRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/forEach.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/forEachRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/forIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/forInRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/forOwn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/forOwnRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/F.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/T.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/__.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/_baseConvert.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/_convertBrowser.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/_falseOptions.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/_mapping.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/_util.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/add.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/after.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/all.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/allPass.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/always.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/any.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/anyPass.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/apply.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/array.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/ary.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/assign.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/assignAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/assignAllWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/assignIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/assignInAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/assignInAllWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/assignInWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/assignWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/assoc.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/assocPath.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/at.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/attempt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/before.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/bind.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/bindAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/bindKey.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/camelCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/capitalize.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/castArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/ceil.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/chain.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/chunk.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/clamp.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/clone.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/cloneDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/cloneDeepWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/cloneWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/collection.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/commit.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/compact.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/complement.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/compose.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/concat.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/cond.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/conforms.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/conformsTo.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/constant.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/contains.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/convert.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/countBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/create.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/curry.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/curryN.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/curryRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/curryRightN.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/date.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/debounce.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/deburr.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/defaultTo.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/defaults.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/defaultsAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/defaultsDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/defaultsDeepAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/defer.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/delay.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/difference.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/differenceBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/differenceWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/dissoc.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/dissocPath.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/divide.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/drop.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/dropLast.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/dropLastWhile.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/dropRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/dropRightWhile.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/dropWhile.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/each.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/eachRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/endsWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/entries.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/entriesIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/eq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/equals.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/escape.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/escapeRegExp.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/every.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/extend.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/extendAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/extendAllWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/extendWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/fill.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/filter.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/find.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/findFrom.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/findIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/findIndexFrom.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/findKey.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/findLast.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/findLastFrom.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/findLastIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/findLastIndexFrom.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/findLastKey.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/first.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/flatMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/flatMapDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/flatMapDepth.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/flatten.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/flattenDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/flattenDepth.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/flip.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/floor.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/flow.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/flowRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/forEach.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/forEachRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/forIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/forInRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/forOwn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/forOwnRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/fromPairs.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/function.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/functions.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/functionsIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/get.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/getOr.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/groupBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/gt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/gte.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/has.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/hasIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/head.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/identical.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/identity.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/inRange.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/includes.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/includesFrom.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/indexBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/indexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/indexOfFrom.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/init.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/initial.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/intersection.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/intersectionBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/intersectionWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/invert.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/invertBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/invertObj.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/invoke.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/invokeArgs.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/invokeArgsMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/invokeMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isArguments.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isArrayBuffer.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isArrayLike.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isArrayLikeObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isBoolean.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isBuffer.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isDate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isElement.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isEmpty.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isEqual.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isEqualWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isError.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isFinite.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isFunction.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isInteger.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isLength.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isMatch.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isMatchWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isNaN.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isNative.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isNil.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isNull.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isNumber.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isObjectLike.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isPlainObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isRegExp.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isSafeInteger.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isSet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isString.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isSymbol.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isTypedArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isUndefined.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isWeakMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/isWeakSet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/iteratee.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/join.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/juxt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/kebabCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/keyBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/keys.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/keysIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/lang.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/last.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/lastIndexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/lastIndexOfFrom.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/lowerCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/lowerFirst.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/lt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/lte.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/map.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/mapKeys.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/mapValues.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/matches.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/matchesProperty.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/math.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/max.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/maxBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/mean.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/meanBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/memoize.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/merge.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/mergeAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/mergeAllWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/mergeWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/method.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/methodOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/min.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/minBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/mixin.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/multiply.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/nAry.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/negate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/next.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/noop.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/now.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/nth.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/nthArg.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/number.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/object.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/omit.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/omitAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/omitBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/once.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/orderBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/over.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/overArgs.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/overEvery.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/overSome.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pad.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/padChars.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/padCharsEnd.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/padCharsStart.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/padEnd.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/padStart.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/parseInt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/partial.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/partialRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/partition.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/path.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pathEq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pathOr.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/paths.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pick.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pickAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pickBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pipe.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/placeholder.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/plant.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pluck.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/prop.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/propEq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/propOr.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/property.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/propertyOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/props.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pull.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pullAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pullAllBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pullAllWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/pullAt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/random.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/range.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/rangeRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/rangeStep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/rangeStepRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/rearg.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/reduce.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/reduceRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/reject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/remove.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/repeat.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/replace.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/rest.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/restFrom.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/result.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/reverse.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/round.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sample.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sampleSize.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/seq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/set.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/setWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/shuffle.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/size.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/slice.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/snakeCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/some.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sortBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sortedIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sortedIndexBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sortedIndexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sortedLastIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sortedLastIndexBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sortedLastIndexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sortedUniq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sortedUniqBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/split.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/spread.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/spreadFrom.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/startCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/startsWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/string.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/stubArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/stubFalse.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/stubObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/stubString.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/stubTrue.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/subtract.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sum.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/sumBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/symmetricDifference.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/symmetricDifferenceBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/symmetricDifferenceWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/tail.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/take.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/takeLast.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/takeLastWhile.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/takeRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/takeRightWhile.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/takeWhile.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/tap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/template.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/templateSettings.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/throttle.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/thru.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/times.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toFinite.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toInteger.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toIterator.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toJSON.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toLength.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toLower.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toNumber.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toPairs.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toPairsIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toPath.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toPlainObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toSafeInteger.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toString.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/toUpper.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/transform.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/trim.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/trimChars.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/trimCharsEnd.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/trimCharsStart.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/trimEnd.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/trimStart.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/truncate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/unapply.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/unary.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/unescape.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/union.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/unionBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/unionWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/uniq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/uniqBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/uniqWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/uniqueId.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/unnest.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/unset.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/unzip.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/unzipWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/update.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/updateWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/upperCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/upperFirst.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/useWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/util.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/value.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/valueOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/values.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/valuesIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/where.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/whereEq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/without.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/words.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/wrap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/wrapperAt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/wrapperChain.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/wrapperLodash.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/wrapperReverse.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/wrapperValue.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/xor.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/xorBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/xorWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/zip.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/zipAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/zipObj.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/zipObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/zipObjectDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fp/zipWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/fromPairs.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/function.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/functions.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/functionsIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/get.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/groupBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/gt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/gte.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/has.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/hasIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/head.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/identity.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/inRange.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/includes.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/indexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/initial.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/intersection.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/intersectionBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/intersectionWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/invert.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/invertBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/invoke.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/invokeMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isArguments.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isArrayBuffer.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isArrayLike.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isArrayLikeObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isBoolean.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isBuffer.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isDate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isElement.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isEmpty.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isEqual.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isEqualWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isError.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isFinite.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isFunction.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isInteger.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isLength.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isMatch.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isMatchWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isNaN.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isNative.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isNil.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isNull.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isNumber.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isObjectLike.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isPlainObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isRegExp.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isSafeInteger.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isSet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isString.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isSymbol.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isTypedArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isUndefined.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isWeakMap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/isWeakSet.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/iteratee.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/join.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/kebabCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/keyBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/keys.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/keysIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/lang.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/last.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/lastIndexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/lodash.js (99%) create mode 100644 tools/node_modules/@babel/core/node_modules/lodash/lodash.min.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/lowerCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/lowerFirst.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/lt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/lte.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/map.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/mapKeys.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/mapValues.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/matches.js (79%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/matchesProperty.js (79%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/math.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/max.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/maxBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/mean.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/meanBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/memoize.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/merge.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/mergeWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/method.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/methodOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/min.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/minBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/mixin.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/multiply.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/negate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/next.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/noop.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/now.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/nth.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/nthArg.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/number.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/object.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/omit.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/omitBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/once.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/orderBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/over.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/overArgs.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/overEvery.js (71%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/overSome.js (62%) create mode 100644 tools/node_modules/@babel/core/node_modules/lodash/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/pad.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/padEnd.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/padStart.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/parseInt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/partial.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/partialRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/partition.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/pick.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/pickBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/plant.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/property.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/propertyOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/pull.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/pullAll.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/pullAllBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/pullAllWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/pullAt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/random.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/range.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/rangeRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/rearg.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/reduce.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/reduceRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/reject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/remove.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/repeat.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/replace.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/rest.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/result.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/reverse.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/round.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sample.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sampleSize.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/seq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/set.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/setWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/shuffle.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/size.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/slice.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/snakeCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/some.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sortBy.js (92%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sortedIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sortedIndexBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sortedIndexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sortedLastIndex.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sortedLastIndexBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sortedLastIndexOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sortedUniq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sortedUniqBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/split.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/spread.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/startCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/startsWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/string.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/stubArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/stubFalse.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/stubObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/stubString.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/stubTrue.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/subtract.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sum.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/sumBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/tail.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/take.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/takeRight.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/takeRightWhile.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/takeWhile.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/tap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/template.js (96%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/templateSettings.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/throttle.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/thru.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/times.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toArray.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toFinite.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toInteger.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toIterator.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toJSON.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toLength.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toLower.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toNumber.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toPairs.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toPairsIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toPath.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toPlainObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toSafeInteger.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toString.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/toUpper.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/transform.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/trim.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/trimEnd.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/trimStart.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/truncate.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/unary.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/unescape.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/union.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/unionBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/unionWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/uniq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/uniqBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/uniqWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/uniqueId.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/unset.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/unzip.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/unzipWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/update.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/updateWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/upperCase.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/upperFirst.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/util.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/value.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/valueOf.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/values.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/valuesIn.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/without.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/words.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/wrap.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/wrapperAt.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/wrapperChain.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/wrapperLodash.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/wrapperReverse.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/wrapperValue.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/xor.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/xorBy.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/xorWith.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/zip.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/zipObject.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/zipObjectDeep.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/lodash/zipWith.js (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/minimist/LICENSE create mode 100644 tools/node_modules/@babel/core/node_modules/minimist/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/minimist/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/minimist/readme.markdown rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/ms/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/ms/license.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/ms/package.json (69%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/ms/readme.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/path-parse/LICENSE (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/path-parse/README.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/path-parse/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/path-parse/package.json (69%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/resolve/LICENSE (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/resolve/index.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/resolve/lib/async.js (58%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/resolve/lib/caller.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/resolve/lib/core.js (93%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/resolve/lib/core.json (87%) create mode 100644 tools/node_modules/@babel/core/node_modules/resolve/lib/is-core.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/resolve/lib/node-modules-paths.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/resolve/lib/normalize-options.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/resolve/lib/sync.js (63%) create mode 100644 tools/node_modules/@babel/core/node_modules/resolve/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/resolve/readme.markdown (67%) rename tools/node_modules/{babel-eslint/node_modules/trim-right/license => @babel/core/node_modules/safe-buffer/LICENSE} (93%) create mode 100644 tools/node_modules/@babel/core/node_modules/safe-buffer/README.md create mode 100644 tools/node_modules/@babel/core/node_modules/safe-buffer/index.js create mode 100644 tools/node_modules/@babel/core/node_modules/safe-buffer/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/semver/LICENSE create mode 100644 tools/node_modules/@babel/core/node_modules/semver/README.md create mode 100755 tools/node_modules/@babel/core/node_modules/semver/bin/semver create mode 100644 tools/node_modules/@babel/core/node_modules/semver/package.json create mode 100644 tools/node_modules/@babel/core/node_modules/semver/range.bnf create mode 100644 tools/node_modules/@babel/core/node_modules/semver/semver.js rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/LICENSE (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/README.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/dist/source-map.debug.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/dist/source-map.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/dist/source-map.min.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/lib/array-set.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/lib/base64-vlq.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/lib/base64.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/lib/binary-search.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/lib/mapping-list.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/lib/quick-sort.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/lib/source-map-consumer.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/lib/source-map-generator.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/lib/source-node.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/lib/util.js (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/source-map/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/source-map/source-map.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/supports-color/browser.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/supports-color/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/supports-color/license (100%) create mode 100644 tools/node_modules/@babel/core/node_modules/supports-color/package.json rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/supports-color/readme.md (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/to-fast-properties/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/to-fast-properties/license (100%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/to-fast-properties/package.json (61%) rename tools/node_modules/{babel-eslint => @babel/core}/node_modules/to-fast-properties/readme.md (100%) create mode 100644 tools/node_modules/@babel/core/package.json create mode 100644 tools/node_modules/@babel/core/src/config/files/index-browser.js create mode 100644 tools/node_modules/@babel/core/src/config/files/index.js create mode 100644 tools/node_modules/@babel/core/src/transform-file-browser.js create mode 100644 tools/node_modules/@babel/core/src/transform-file.js create mode 100644 tools/node_modules/@babel/eslint-parser/LICENSE create mode 100644 tools/node_modules/@babel/eslint-parser/README.md rename tools/node_modules/{babel-eslint => @babel/eslint-parser}/lib/analyze-scope.js (62%) create mode 100644 tools/node_modules/@babel/eslint-parser/lib/configuration.js create mode 100644 tools/node_modules/@babel/eslint-parser/lib/convert/convertAST.js rename tools/node_modules/{babel-eslint/lib/babylon-to-espree => @babel/eslint-parser/lib/convert}/convertComments.js (55%) create mode 100644 tools/node_modules/@babel/eslint-parser/lib/convert/convertTokens.js create mode 100644 tools/node_modules/@babel/eslint-parser/lib/convert/index.js create mode 100644 tools/node_modules/@babel/eslint-parser/lib/index.js create mode 100644 tools/node_modules/@babel/eslint-parser/lib/visitor-keys.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/LICENSE create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/README.md create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/definition.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/index.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/pattern-visitor.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/reference.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/referencer.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/scope-manager.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/scope.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/variable.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/package.json rename tools/node_modules/{babel-eslint => @babel/eslint-parser}/node_modules/eslint-visitor-keys/LICENSE (100%) rename tools/node_modules/{babel-eslint => @babel/eslint-parser}/node_modules/eslint-visitor-keys/README.md (100%) rename tools/node_modules/{babel-eslint => @babel/eslint-parser}/node_modules/eslint-visitor-keys/lib/index.js (100%) rename tools/node_modules/{babel-eslint => @babel/eslint-parser}/node_modules/eslint-visitor-keys/lib/visitor-keys.json (98%) rename tools/node_modules/{babel-eslint => @babel/eslint-parser}/node_modules/eslint-visitor-keys/package.json (73%) create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/README.md create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/esrecurse.js rename tools/node_modules/{babel-eslint/node_modules/esutils => @babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse}/LICENSE.BSD (100%) create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/README.md create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/estraverse.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/package.json create mode 100755 tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/package.json create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/estraverse/LICENSE.BSD create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/estraverse/README.md create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/estraverse/estraverse.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/estraverse/package.json create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/semver/LICENSE create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/semver/README.md create mode 100755 tools/node_modules/@babel/eslint-parser/node_modules/semver/bin/semver.js create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/semver/package.json create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/semver/range.bnf create mode 100644 tools/node_modules/@babel/eslint-parser/node_modules/semver/semver.js create mode 100644 tools/node_modules/@babel/eslint-parser/package.json create mode 100644 tools/node_modules/@babel/plugin-syntax-class-properties/LICENSE create mode 100644 tools/node_modules/@babel/plugin-syntax-class-properties/README.md create mode 100644 tools/node_modules/@babel/plugin-syntax-class-properties/lib/index.js create mode 100644 tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/LICENSE create mode 100644 tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/README.md create mode 100644 tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/lib/index.js create mode 100644 tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/package.json create mode 100644 tools/node_modules/@babel/plugin-syntax-class-properties/package.json delete mode 100644 tools/node_modules/babel-eslint/README.md delete mode 100644 tools/node_modules/babel-eslint/lib/babylon-to-espree/attachComments.js delete mode 100644 tools/node_modules/babel-eslint/lib/babylon-to-espree/convertTemplateType.js delete mode 100644 tools/node_modules/babel-eslint/lib/babylon-to-espree/index.js delete mode 100644 tools/node_modules/babel-eslint/lib/babylon-to-espree/toAST.js delete mode 100644 tools/node_modules/babel-eslint/lib/babylon-to-espree/toToken.js delete mode 100644 tools/node_modules/babel-eslint/lib/babylon-to-espree/toTokens.js delete mode 100644 tools/node_modules/babel-eslint/lib/index.js delete mode 100644 tools/node_modules/babel-eslint/lib/parse-with-scope.js delete mode 100644 tools/node_modules/babel-eslint/lib/parse.js delete mode 100644 tools/node_modules/babel-eslint/lib/require-from-eslint.js delete mode 100644 tools/node_modules/babel-eslint/lib/visitor-keys.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/generator/README.md delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/node/parentheses.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/generator/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/lib/index.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/helper-split-export-declaration/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/parser/README.md delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/template/README.md delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/template/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/comments.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/inference/index.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/traverse/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/README.md delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/generated/index.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneNode.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/core.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/es2015.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/misc.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/inherit.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isScope.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidIdentifier.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/flow.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/typescript.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/ansi-styles/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/chalk/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/debug/dist/debug.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/debug/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/escape-string-regexp/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/esutils/README.md delete mode 100644 tools/node_modules/babel-eslint/node_modules/esutils/lib/ast.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/esutils/lib/code.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/esutils/lib/keyword.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/esutils/lib/utils.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/esutils/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/globals/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/lodash/core.min.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/lodash/lodash.min.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/lodash/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/index.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/resolve/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/source-map/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/supports-color/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/trim-right/index.js delete mode 100644 tools/node_modules/babel-eslint/node_modules/trim-right/package.json delete mode 100644 tools/node_modules/babel-eslint/node_modules/trim-right/readme.md delete mode 100644 tools/node_modules/babel-eslint/package.json diff --git a/.eslintrc.js b/.eslintrc.js index 06711298a7f0b2..0543f569a60c38 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,7 +16,8 @@ const ModuleFindPath = Module._findPath; const hacks = [ 'eslint-plugin-node-core', 'eslint-plugin-markdown', - 'babel-eslint', + '@babel/eslint-parser', + '@babel/plugin-syntax-class-properties', ]; Module._findPath = (request, paths, isMain) => { const r = ModuleFindPath(request, paths, isMain); @@ -37,8 +38,14 @@ Module._findPath = (request, paths, isMain) => { module.exports = { root: true, plugins: ['markdown', 'node-core'], - parser: 'babel-eslint', - parserOptions: { sourceType: 'script' }, + parser: '@babel/eslint-parser', + parserOptions: { + babelOptions: { + plugins: [Module._findPath('@babel/plugin-syntax-class-properties')], + }, + requireConfigFile: false, + sourceType: 'script', + }, overrides: [ { files: [ diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index cbbf091f04b8a7..7613449c92b477 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -1282,7 +1282,7 @@ assert.throws( ); assert.throws( - () => a.notStrictEqual(5n), + () => a.notStrictEqual(5n), // eslint-disable-line no-restricted-syntax { code: 'ERR_MISSING_ARGS' } ); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/LICENSE b/tools/node_modules/@babel/core/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/code-frame/LICENSE rename to tools/node_modules/@babel/core/LICENSE diff --git a/tools/node_modules/@babel/core/README.md b/tools/node_modules/@babel/core/README.md new file mode 100644 index 00000000000000..9b3a9503360cbb --- /dev/null +++ b/tools/node_modules/@babel/core/README.md @@ -0,0 +1,19 @@ +# @babel/core + +> Babel compiler core. + +See our website [@babel/core](https://babeljs.io/docs/en/babel-core) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/core +``` + +or using yarn: + +```sh +yarn add @babel/core --dev +``` diff --git a/tools/node_modules/@babel/core/lib/config/caching.js b/tools/node_modules/@babel/core/lib/config/caching.js new file mode 100644 index 00000000000000..acd576b1cef295 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/caching.js @@ -0,0 +1,327 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.makeWeakCache = makeWeakCache; +exports.makeWeakCacheSync = makeWeakCacheSync; +exports.makeStrongCache = makeStrongCache; +exports.makeStrongCacheSync = makeStrongCacheSync; +exports.assertSimpleType = assertSimpleType; + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +var _async = require("../gensync-utils/async"); + +var _util = require("./util"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const synchronize = gen => { + return (0, _gensync().default)(gen).sync; +}; + +function* genTrue(data) { + return true; +} + +function makeWeakCache(handler) { + return makeCachedFunction(WeakMap, handler); +} + +function makeWeakCacheSync(handler) { + return synchronize(makeWeakCache(handler)); +} + +function makeStrongCache(handler) { + return makeCachedFunction(Map, handler); +} + +function makeStrongCacheSync(handler) { + return synchronize(makeStrongCache(handler)); +} + +function makeCachedFunction(CallCache, handler) { + const callCacheSync = new CallCache(); + const callCacheAsync = new CallCache(); + const futureCache = new CallCache(); + return function* cachedFunction(arg, data) { + const asyncContext = yield* (0, _async.isAsync)(); + const callCache = asyncContext ? callCacheAsync : callCacheSync; + const cached = yield* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data); + if (cached.valid) return cached.value; + const cache = new CacheConfigurator(data); + const handlerResult = handler(arg, cache); + let finishLock; + let value; + + if ((0, _util.isIterableIterator)(handlerResult)) { + const gen = handlerResult; + value = yield* (0, _async.onFirstPause)(gen, () => { + finishLock = setupAsyncLocks(cache, futureCache, arg); + }); + } else { + value = handlerResult; + } + + updateFunctionCache(callCache, cache, arg, value); + + if (finishLock) { + futureCache.delete(arg); + finishLock.release(value); + } + + return value; + }; +} + +function* getCachedValue(cache, arg, data) { + const cachedValue = cache.get(arg); + + if (cachedValue) { + for (const { + value, + valid + } of cachedValue) { + if (yield* valid(data)) return { + valid: true, + value + }; + } + } + + return { + valid: false, + value: null + }; +} + +function* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) { + const cached = yield* getCachedValue(callCache, arg, data); + + if (cached.valid) { + return cached; + } + + if (asyncContext) { + const cached = yield* getCachedValue(futureCache, arg, data); + + if (cached.valid) { + const value = yield* (0, _async.waitFor)(cached.value.promise); + return { + valid: true, + value + }; + } + } + + return { + valid: false, + value: null + }; +} + +function setupAsyncLocks(config, futureCache, arg) { + const finishLock = new Lock(); + updateFunctionCache(futureCache, config, arg, finishLock); + return finishLock; +} + +function updateFunctionCache(cache, config, arg, value) { + if (!config.configured()) config.forever(); + let cachedValue = cache.get(arg); + config.deactivate(); + + switch (config.mode()) { + case "forever": + cachedValue = [{ + value, + valid: genTrue + }]; + cache.set(arg, cachedValue); + break; + + case "invalidate": + cachedValue = [{ + value, + valid: config.validator() + }]; + cache.set(arg, cachedValue); + break; + + case "valid": + if (cachedValue) { + cachedValue.push({ + value, + valid: config.validator() + }); + } else { + cachedValue = [{ + value, + valid: config.validator() + }]; + cache.set(arg, cachedValue); + } + + } +} + +class CacheConfigurator { + constructor(data) { + this._active = true; + this._never = false; + this._forever = false; + this._invalidate = false; + this._configured = false; + this._pairs = []; + this._data = void 0; + this._data = data; + } + + simple() { + return makeSimpleConfigurator(this); + } + + mode() { + if (this._never) return "never"; + if (this._forever) return "forever"; + if (this._invalidate) return "invalidate"; + return "valid"; + } + + forever() { + if (!this._active) { + throw new Error("Cannot change caching after evaluation has completed."); + } + + if (this._never) { + throw new Error("Caching has already been configured with .never()"); + } + + this._forever = true; + this._configured = true; + } + + never() { + if (!this._active) { + throw new Error("Cannot change caching after evaluation has completed."); + } + + if (this._forever) { + throw new Error("Caching has already been configured with .forever()"); + } + + this._never = true; + this._configured = true; + } + + using(handler) { + if (!this._active) { + throw new Error("Cannot change caching after evaluation has completed."); + } + + if (this._never || this._forever) { + throw new Error("Caching has already been configured with .never or .forever()"); + } + + this._configured = true; + const key = handler(this._data); + const fn = (0, _async.maybeAsync)(handler, `You appear to be using an async cache handler, but Babel has been called synchronously`); + + if ((0, _async.isThenable)(key)) { + return key.then(key => { + this._pairs.push([key, fn]); + + return key; + }); + } + + this._pairs.push([key, fn]); + + return key; + } + + invalidate(handler) { + this._invalidate = true; + return this.using(handler); + } + + validator() { + const pairs = this._pairs; + return function* (data) { + for (const [key, fn] of pairs) { + if (key !== (yield* fn(data))) return false; + } + + return true; + }; + } + + deactivate() { + this._active = false; + } + + configured() { + return this._configured; + } + +} + +function makeSimpleConfigurator(cache) { + function cacheFn(val) { + if (typeof val === "boolean") { + if (val) cache.forever();else cache.never(); + return; + } + + return cache.using(() => assertSimpleType(val())); + } + + cacheFn.forever = () => cache.forever(); + + cacheFn.never = () => cache.never(); + + cacheFn.using = cb => cache.using(() => assertSimpleType(cb())); + + cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb())); + + return cacheFn; +} + +function assertSimpleType(value) { + if ((0, _async.isThenable)(value)) { + throw new Error(`You appear to be using an async cache handler, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously handle your caching logic.`); + } + + if (value != null && typeof value !== "string" && typeof value !== "boolean" && typeof value !== "number") { + throw new Error("Cache keys must be either string, boolean, number, null, or undefined."); + } + + return value; +} + +class Lock { + constructor() { + this.released = false; + this.promise = void 0; + this._resolve = void 0; + this.promise = new Promise(resolve => { + this._resolve = resolve; + }); + } + + release(value) { + this.released = true; + + this._resolve(value); + } + +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/config-chain.js b/tools/node_modules/@babel/core/lib/config/config-chain.js new file mode 100644 index 00000000000000..60116cb417eb79 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/config-chain.js @@ -0,0 +1,552 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.buildPresetChain = buildPresetChain; +exports.buildRootChain = buildRootChain; +exports.buildPresetChainWalker = void 0; + +function _path() { + const data = _interopRequireDefault(require("path")); + + _path = function () { + return data; + }; + + return data; +} + +function _debug() { + const data = _interopRequireDefault(require("debug")); + + _debug = function () { + return data; + }; + + return data; +} + +var _options = require("./validation/options"); + +var _patternToRegex = _interopRequireDefault(require("./pattern-to-regex")); + +var _printer = require("./printer"); + +var _files = require("./files"); + +var _caching = require("./caching"); + +var _configDescriptors = require("./config-descriptors"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const debug = (0, _debug().default)("babel:config:config-chain"); + +function* buildPresetChain(arg, context) { + const chain = yield* buildPresetChainWalker(arg, context); + if (!chain) return null; + return { + plugins: dedupDescriptors(chain.plugins), + presets: dedupDescriptors(chain.presets), + options: chain.options.map(o => normalizeOptions(o)), + files: new Set() + }; +} + +const buildPresetChainWalker = makeChainWalker({ + root: preset => loadPresetDescriptors(preset), + env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName), + overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index), + overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName), + createLogger: () => () => {} +}); +exports.buildPresetChainWalker = buildPresetChainWalker; +const loadPresetDescriptors = (0, _caching.makeWeakCacheSync)(preset => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors)); +const loadPresetEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName))); +const loadPresetOverridesDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index))); +const loadPresetOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index, envName)))); + +function* buildRootChain(opts, context) { + let configReport, babelRcReport; + const programmaticLogger = new _printer.ConfigPrinter(); + const programmaticChain = yield* loadProgrammaticChain({ + options: opts, + dirname: context.cwd + }, context, undefined, programmaticLogger); + if (!programmaticChain) return null; + const programmaticReport = programmaticLogger.output(); + let configFile; + + if (typeof opts.configFile === "string") { + configFile = yield* (0, _files.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller); + } else if (opts.configFile !== false) { + configFile = yield* (0, _files.findRootConfig)(context.root, context.envName, context.caller); + } + + let { + babelrc, + babelrcRoots + } = opts; + let babelrcRootsDirectory = context.cwd; + const configFileChain = emptyChain(); + const configFileLogger = new _printer.ConfigPrinter(); + + if (configFile) { + const validatedFile = validateConfigFile(configFile); + const result = yield* loadFileChain(validatedFile, context, undefined, configFileLogger); + if (!result) return null; + configReport = configFileLogger.output(); + + if (babelrc === undefined) { + babelrc = validatedFile.options.babelrc; + } + + if (babelrcRoots === undefined) { + babelrcRootsDirectory = validatedFile.dirname; + babelrcRoots = validatedFile.options.babelrcRoots; + } + + mergeChain(configFileChain, result); + } + + const pkgData = typeof context.filename === "string" ? yield* (0, _files.findPackageData)(context.filename) : null; + let ignoreFile, babelrcFile; + let isIgnored = false; + const fileChain = emptyChain(); + + if ((babelrc === true || babelrc === undefined) && pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) { + ({ + ignore: ignoreFile, + config: babelrcFile + } = yield* (0, _files.findRelativeConfig)(pkgData, context.envName, context.caller)); + + if (ignoreFile) { + fileChain.files.add(ignoreFile.filepath); + } + + if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) { + isIgnored = true; + } + + if (babelrcFile && !isIgnored) { + const validatedFile = validateBabelrcFile(babelrcFile); + const babelrcLogger = new _printer.ConfigPrinter(); + const result = yield* loadFileChain(validatedFile, context, undefined, babelrcLogger); + + if (!result) { + isIgnored = true; + } else { + babelRcReport = babelrcLogger.output(); + mergeChain(fileChain, result); + } + } + + if (babelrcFile && isIgnored) { + fileChain.files.add(babelrcFile.filepath); + } + } + + if (context.showConfig) { + console.log(`Babel configs on "${context.filename}" (ascending priority):\n` + [configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n")); + return null; + } + + const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain); + return { + plugins: isIgnored ? [] : dedupDescriptors(chain.plugins), + presets: isIgnored ? [] : dedupDescriptors(chain.presets), + options: isIgnored ? [] : chain.options.map(o => normalizeOptions(o)), + fileHandling: isIgnored ? "ignored" : "transpile", + ignore: ignoreFile || undefined, + babelrc: babelrcFile || undefined, + config: configFile || undefined, + files: chain.files + }; +} + +function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) { + if (typeof babelrcRoots === "boolean") return babelrcRoots; + const absoluteRoot = context.root; + + if (babelrcRoots === undefined) { + return pkgData.directories.indexOf(absoluteRoot) !== -1; + } + + let babelrcPatterns = babelrcRoots; + if (!Array.isArray(babelrcPatterns)) babelrcPatterns = [babelrcPatterns]; + babelrcPatterns = babelrcPatterns.map(pat => { + return typeof pat === "string" ? _path().default.resolve(babelrcRootsDirectory, pat) : pat; + }); + + if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) { + return pkgData.directories.indexOf(absoluteRoot) !== -1; + } + + return babelrcPatterns.some(pat => { + if (typeof pat === "string") { + pat = (0, _patternToRegex.default)(pat, babelrcRootsDirectory); + } + + return pkgData.directories.some(directory => { + return matchPattern(pat, babelrcRootsDirectory, directory, context); + }); + }); +} + +const validateConfigFile = (0, _caching.makeWeakCacheSync)(file => ({ + filepath: file.filepath, + dirname: file.dirname, + options: (0, _options.validate)("configfile", file.options) +})); +const validateBabelrcFile = (0, _caching.makeWeakCacheSync)(file => ({ + filepath: file.filepath, + dirname: file.dirname, + options: (0, _options.validate)("babelrcfile", file.options) +})); +const validateExtendFile = (0, _caching.makeWeakCacheSync)(file => ({ + filepath: file.filepath, + dirname: file.dirname, + options: (0, _options.validate)("extendsfile", file.options) +})); +const loadProgrammaticChain = makeChainWalker({ + root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors), + env: (input, envName) => buildEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, envName), + overrides: (input, index) => buildOverrideDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index), + overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index, envName), + createLogger: (input, context, baseLogger) => buildProgrammaticLogger(input, context, baseLogger) +}); +const loadFileChainWalker = makeChainWalker({ + root: file => loadFileDescriptors(file), + env: (file, envName) => loadFileEnvDescriptors(file)(envName), + overrides: (file, index) => loadFileOverridesDescriptors(file)(index), + overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName), + createLogger: (file, context, baseLogger) => buildFileLogger(file.filepath, context, baseLogger) +}); + +function* loadFileChain(input, context, files, baseLogger) { + const chain = yield* loadFileChainWalker(input, context, files, baseLogger); + + if (chain) { + chain.files.add(input.filepath); + } + + return chain; +} + +const loadFileDescriptors = (0, _caching.makeWeakCacheSync)(file => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors)); +const loadFileEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName))); +const loadFileOverridesDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index))); +const loadFileOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index, envName)))); + +function buildFileLogger(filepath, context, baseLogger) { + if (!baseLogger) { + return () => {}; + } + + return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Config, { + filepath + }); +} + +function buildRootDescriptors({ + dirname, + options +}, alias, descriptors) { + return descriptors(dirname, options, alias); +} + +function buildProgrammaticLogger(_, context, baseLogger) { + var _context$caller; + + if (!baseLogger) { + return () => {}; + } + + return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Programmatic, { + callerName: (_context$caller = context.caller) == null ? void 0 : _context$caller.name + }); +} + +function buildEnvDescriptors({ + dirname, + options +}, alias, descriptors, envName) { + const opts = options.env && options.env[envName]; + return opts ? descriptors(dirname, opts, `${alias}.env["${envName}"]`) : null; +} + +function buildOverrideDescriptors({ + dirname, + options +}, alias, descriptors, index) { + const opts = options.overrides && options.overrides[index]; + if (!opts) throw new Error("Assertion failure - missing override"); + return descriptors(dirname, opts, `${alias}.overrides[${index}]`); +} + +function buildOverrideEnvDescriptors({ + dirname, + options +}, alias, descriptors, index, envName) { + const override = options.overrides && options.overrides[index]; + if (!override) throw new Error("Assertion failure - missing override"); + const opts = override.env && override.env[envName]; + return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null; +} + +function makeChainWalker({ + root, + env, + overrides, + overridesEnv, + createLogger +}) { + return function* (input, context, files = new Set(), baseLogger) { + const { + dirname + } = input; + const flattenedConfigs = []; + const rootOpts = root(input); + + if (configIsApplicable(rootOpts, dirname, context)) { + flattenedConfigs.push({ + config: rootOpts, + envName: undefined, + index: undefined + }); + const envOpts = env(input, context.envName); + + if (envOpts && configIsApplicable(envOpts, dirname, context)) { + flattenedConfigs.push({ + config: envOpts, + envName: context.envName, + index: undefined + }); + } + + (rootOpts.options.overrides || []).forEach((_, index) => { + const overrideOps = overrides(input, index); + + if (configIsApplicable(overrideOps, dirname, context)) { + flattenedConfigs.push({ + config: overrideOps, + index, + envName: undefined + }); + const overrideEnvOpts = overridesEnv(input, index, context.envName); + + if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context)) { + flattenedConfigs.push({ + config: overrideEnvOpts, + index, + envName: context.envName + }); + } + } + }); + } + + if (flattenedConfigs.some(({ + config: { + options: { + ignore, + only + } + } + }) => shouldIgnore(context, ignore, only, dirname))) { + return null; + } + + const chain = emptyChain(); + const logger = createLogger(input, context, baseLogger); + + for (const { + config, + index, + envName + } of flattenedConfigs) { + if (!(yield* mergeExtendsChain(chain, config.options, dirname, context, files, baseLogger))) { + return null; + } + + logger(config, index, envName); + mergeChainOpts(chain, config); + } + + return chain; + }; +} + +function* mergeExtendsChain(chain, opts, dirname, context, files, baseLogger) { + if (opts.extends === undefined) return true; + const file = yield* (0, _files.loadConfig)(opts.extends, dirname, context.envName, context.caller); + + if (files.has(file)) { + throw new Error(`Configuration cycle detected loading ${file.filepath}.\n` + `File already loaded following the config chain:\n` + Array.from(files, file => ` - ${file.filepath}`).join("\n")); + } + + files.add(file); + const fileChain = yield* loadFileChain(validateExtendFile(file), context, files, baseLogger); + files.delete(file); + if (!fileChain) return false; + mergeChain(chain, fileChain); + return true; +} + +function mergeChain(target, source) { + target.options.push(...source.options); + target.plugins.push(...source.plugins); + target.presets.push(...source.presets); + + for (const file of source.files) { + target.files.add(file); + } + + return target; +} + +function mergeChainOpts(target, { + options, + plugins, + presets +}) { + target.options.push(options); + target.plugins.push(...plugins()); + target.presets.push(...presets()); + return target; +} + +function emptyChain() { + return { + options: [], + presets: [], + plugins: [], + files: new Set() + }; +} + +function normalizeOptions(opts) { + const options = Object.assign({}, opts); + delete options.extends; + delete options.env; + delete options.overrides; + delete options.plugins; + delete options.presets; + delete options.passPerPreset; + delete options.ignore; + delete options.only; + delete options.test; + delete options.include; + delete options.exclude; + + if (Object.prototype.hasOwnProperty.call(options, "sourceMap")) { + options.sourceMaps = options.sourceMap; + delete options.sourceMap; + } + + return options; +} + +function dedupDescriptors(items) { + const map = new Map(); + const descriptors = []; + + for (const item of items) { + if (typeof item.value === "function") { + const fnKey = item.value; + let nameMap = map.get(fnKey); + + if (!nameMap) { + nameMap = new Map(); + map.set(fnKey, nameMap); + } + + let desc = nameMap.get(item.name); + + if (!desc) { + desc = { + value: item + }; + descriptors.push(desc); + if (!item.ownPass) nameMap.set(item.name, desc); + } else { + desc.value = item; + } + } else { + descriptors.push({ + value: item + }); + } + } + + return descriptors.reduce((acc, desc) => { + acc.push(desc.value); + return acc; + }, []); +} + +function configIsApplicable({ + options +}, dirname, context) { + return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname)); +} + +function configFieldIsApplicable(context, test, dirname) { + const patterns = Array.isArray(test) ? test : [test]; + return matchesPatterns(context, patterns, dirname); +} + +function shouldIgnore(context, ignore, only, dirname) { + if (ignore && matchesPatterns(context, ignore, dirname)) { + var _context$filename; + + const message = `No config is applied to "${(_context$filename = context.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore)}\` from "${dirname}"`; + debug(message); + + if (context.showConfig) { + console.log(message); + } + + return true; + } + + if (only && !matchesPatterns(context, only, dirname)) { + var _context$filename2; + + const message = `No config is applied to "${(_context$filename2 = context.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only)}\` from "${dirname}"`; + debug(message); + + if (context.showConfig) { + console.log(message); + } + + return true; + } + + return false; +} + +function matchesPatterns(context, patterns, dirname) { + return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context)); +} + +function matchPattern(pattern, dirname, pathToTest, context) { + if (typeof pattern === "function") { + return !!pattern(pathToTest, { + dirname, + envName: context.envName, + caller: context.caller + }); + } + + if (typeof pathToTest !== "string") { + throw new Error(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`); + } + + if (typeof pattern === "string") { + pattern = (0, _patternToRegex.default)(pattern, dirname); + } + + return pattern.test(pathToTest); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/config-descriptors.js b/tools/node_modules/@babel/core/lib/config/config-descriptors.js new file mode 100644 index 00000000000000..62efa71265ddb4 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/config-descriptors.js @@ -0,0 +1,211 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCachedDescriptors = createCachedDescriptors; +exports.createUncachedDescriptors = createUncachedDescriptors; +exports.createDescriptor = createDescriptor; + +var _files = require("./files"); + +var _item = require("./item"); + +var _caching = require("./caching"); + +function isEqualDescriptor(a, b) { + return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && (a.file && a.file.request) === (b.file && b.file.request) && (a.file && a.file.resolved) === (b.file && b.file.resolved); +} + +function createCachedDescriptors(dirname, options, alias) { + const { + plugins, + presets, + passPerPreset + } = options; + return { + options, + plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => [], + presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => [] + }; +} + +function createUncachedDescriptors(dirname, options, alias) { + let plugins; + let presets; + return { + options, + plugins: () => { + if (!plugins) { + plugins = createPluginDescriptors(options.plugins || [], dirname, alias); + } + + return plugins; + }, + presets: () => { + if (!presets) { + presets = createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset); + } + + return presets; + } + }; +} + +const PRESET_DESCRIPTOR_CACHE = new WeakMap(); +const createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => { + const dirname = cache.using(dir => dir); + return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCacheSync)(passPerPreset => createPresetDescriptors(items, dirname, alias, passPerPreset).map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc)))); +}); +const PLUGIN_DESCRIPTOR_CACHE = new WeakMap(); +const createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => { + const dirname = cache.using(dir => dir); + return (0, _caching.makeStrongCacheSync)(alias => createPluginDescriptors(items, dirname, alias).map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc))); +}); +const DEFAULT_OPTIONS = {}; + +function loadCachedDescriptor(cache, desc) { + const { + value, + options = DEFAULT_OPTIONS + } = desc; + if (options === false) return desc; + let cacheByOptions = cache.get(value); + + if (!cacheByOptions) { + cacheByOptions = new WeakMap(); + cache.set(value, cacheByOptions); + } + + let possibilities = cacheByOptions.get(options); + + if (!possibilities) { + possibilities = []; + cacheByOptions.set(options, possibilities); + } + + if (possibilities.indexOf(desc) === -1) { + const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc)); + + if (matches.length > 0) { + return matches[0]; + } + + possibilities.push(desc); + } + + return desc; +} + +function createPresetDescriptors(items, dirname, alias, passPerPreset) { + return createDescriptors("preset", items, dirname, alias, passPerPreset); +} + +function createPluginDescriptors(items, dirname, alias) { + return createDescriptors("plugin", items, dirname, alias); +} + +function createDescriptors(type, items, dirname, alias, ownPass) { + const descriptors = items.map((item, index) => createDescriptor(item, dirname, { + type, + alias: `${alias}$${index}`, + ownPass: !!ownPass + })); + assertNoDuplicates(descriptors); + return descriptors; +} + +function createDescriptor(pair, dirname, { + type, + alias, + ownPass +}) { + const desc = (0, _item.getItemDescriptor)(pair); + + if (desc) { + return desc; + } + + let name; + let options; + let value = pair; + + if (Array.isArray(value)) { + if (value.length === 3) { + [value, options, name] = value; + } else { + [value, options] = value; + } + } + + let file = undefined; + let filepath = null; + + if (typeof value === "string") { + if (typeof type !== "string") { + throw new Error("To resolve a string-based item, the type of item must be given"); + } + + const resolver = type === "plugin" ? _files.loadPlugin : _files.loadPreset; + const request = value; + ({ + filepath, + value + } = resolver(value, dirname)); + file = { + request, + resolved: filepath + }; + } + + if (!value) { + throw new Error(`Unexpected falsy value: ${String(value)}`); + } + + if (typeof value === "object" && value.__esModule) { + if (value.default) { + value = value.default; + } else { + throw new Error("Must export a default export when using ES6 modules."); + } + } + + if (typeof value !== "object" && typeof value !== "function") { + throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`); + } + + if (filepath !== null && typeof value === "object" && value) { + throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`); + } + + return { + name, + alias: filepath || alias, + value, + options, + dirname, + ownPass, + file + }; +} + +function assertNoDuplicates(items) { + const map = new Map(); + + for (const item of items) { + if (typeof item.value !== "function") continue; + let nameMap = map.get(item.value); + + if (!nameMap) { + nameMap = new Set(); + map.set(item.value, nameMap); + } + + if (nameMap.has(item.name)) { + const conflicts = items.filter(i => i.value === item.value); + throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n")); + } + + nameMap.add(item.name); + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/files/configuration.js b/tools/node_modules/@babel/core/lib/config/files/configuration.js new file mode 100644 index 00000000000000..999c3269cd2ef8 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/files/configuration.js @@ -0,0 +1,335 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findConfigUpwards = findConfigUpwards; +exports.findRelativeConfig = findRelativeConfig; +exports.findRootConfig = findRootConfig; +exports.loadConfig = loadConfig; +exports.resolveShowConfigPath = resolveShowConfigPath; +exports.ROOT_CONFIG_FILENAMES = void 0; + +function _debug() { + const data = _interopRequireDefault(require("debug")); + + _debug = function () { + return data; + }; + + return data; +} + +function _path() { + const data = _interopRequireDefault(require("path")); + + _path = function () { + return data; + }; + + return data; +} + +function _json() { + const data = _interopRequireDefault(require("json5")); + + _json = function () { + return data; + }; + + return data; +} + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +var _caching = require("../caching"); + +var _configApi = _interopRequireDefault(require("../helpers/config-api")); + +var _utils = require("./utils"); + +var _moduleTypes = _interopRequireDefault(require("./module-types")); + +var _patternToRegex = _interopRequireDefault(require("../pattern-to-regex")); + +var fs = _interopRequireWildcard(require("../../gensync-utils/fs")); + +var _resolve = _interopRequireDefault(require("../../gensync-utils/resolve")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const debug = (0, _debug().default)("babel:config:loading:files:configuration"); +const ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json"]; +exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES; +const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json"]; +const BABELIGNORE_FILENAME = ".babelignore"; + +function* findConfigUpwards(rootDir) { + let dirname = rootDir; + + while (true) { + for (const filename of ROOT_CONFIG_FILENAMES) { + if (yield* fs.exists(_path().default.join(dirname, filename))) { + return dirname; + } + } + + const nextDir = _path().default.dirname(dirname); + + if (dirname === nextDir) break; + dirname = nextDir; + } + + return null; +} + +function* findRelativeConfig(packageData, envName, caller) { + let config = null; + let ignore = null; + + const dirname = _path().default.dirname(packageData.filepath); + + for (const loc of packageData.directories) { + if (!config) { + var _packageData$pkg; + + config = yield* loadOneConfig(RELATIVE_CONFIG_FILENAMES, loc, envName, caller, ((_packageData$pkg = packageData.pkg) == null ? void 0 : _packageData$pkg.dirname) === loc ? packageToBabelConfig(packageData.pkg) : null); + } + + if (!ignore) { + const ignoreLoc = _path().default.join(loc, BABELIGNORE_FILENAME); + + ignore = yield* readIgnoreConfig(ignoreLoc); + + if (ignore) { + debug("Found ignore %o from %o.", ignore.filepath, dirname); + } + } + } + + return { + config, + ignore + }; +} + +function findRootConfig(dirname, envName, caller) { + return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller); +} + +function* loadOneConfig(names, dirname, envName, caller, previousConfig = null) { + const configs = yield* _gensync().default.all(names.map(filename => readConfig(_path().default.join(dirname, filename), envName, caller))); + const config = configs.reduce((previousConfig, config) => { + if (config && previousConfig) { + throw new Error(`Multiple configuration files found. Please remove one:\n` + ` - ${_path().default.basename(previousConfig.filepath)}\n` + ` - ${config.filepath}\n` + `from ${dirname}`); + } + + return config || previousConfig; + }, previousConfig); + + if (config) { + debug("Found configuration %o from %o.", config.filepath, dirname); + } + + return config; +} + +function* loadConfig(name, dirname, envName, caller) { + const filepath = yield* (0, _resolve.default)(name, { + basedir: dirname + }); + const conf = yield* readConfig(filepath, envName, caller); + + if (!conf) { + throw new Error(`Config file ${filepath} contains no configuration data`); + } + + debug("Loaded config %o from %o.", name, dirname); + return conf; +} + +function readConfig(filepath, envName, caller) { + const ext = _path().default.extname(filepath); + + return ext === ".js" || ext === ".cjs" || ext === ".mjs" ? readConfigJS(filepath, { + envName, + caller + }) : readConfigJSON5(filepath); +} + +const LOADING_CONFIGS = new Set(); +const readConfigJS = (0, _caching.makeStrongCache)(function* readConfigJS(filepath, cache) { + if (!fs.exists.sync(filepath)) { + cache.forever(); + return null; + } + + if (LOADING_CONFIGS.has(filepath)) { + cache.never(); + debug("Auto-ignoring usage of config %o.", filepath); + return { + filepath, + dirname: _path().default.dirname(filepath), + options: {} + }; + } + + let options; + + try { + LOADING_CONFIGS.add(filepath); + options = yield* (0, _moduleTypes.default)(filepath, "You appear to be using a native ECMAScript module configuration " + "file, which is only supported when running Babel asynchronously."); + } catch (err) { + err.message = `${filepath}: Error while loading config - ${err.message}`; + throw err; + } finally { + LOADING_CONFIGS.delete(filepath); + } + + let assertCache = false; + + if (typeof options === "function") { + yield* []; + options = options((0, _configApi.default)(cache)); + assertCache = true; + } + + if (!options || typeof options !== "object" || Array.isArray(options)) { + throw new Error(`${filepath}: Configuration should be an exported JavaScript object.`); + } + + if (typeof options.then === "function") { + throw new Error(`You appear to be using an async configuration, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously return your config.`); + } + + if (assertCache && !cache.configured()) throwConfigError(); + return { + filepath, + dirname: _path().default.dirname(filepath), + options + }; +}); +const packageToBabelConfig = (0, _caching.makeWeakCacheSync)(file => { + const babel = file.options["babel"]; + if (typeof babel === "undefined") return null; + + if (typeof babel !== "object" || Array.isArray(babel) || babel === null) { + throw new Error(`${file.filepath}: .babel property must be an object`); + } + + return { + filepath: file.filepath, + dirname: file.dirname, + options: babel + }; +}); +const readConfigJSON5 = (0, _utils.makeStaticFileCache)((filepath, content) => { + let options; + + try { + options = _json().default.parse(content); + } catch (err) { + err.message = `${filepath}: Error while parsing config - ${err.message}`; + throw err; + } + + if (!options) throw new Error(`${filepath}: No config detected`); + + if (typeof options !== "object") { + throw new Error(`${filepath}: Config returned typeof ${typeof options}`); + } + + if (Array.isArray(options)) { + throw new Error(`${filepath}: Expected config object but found array`); + } + + return { + filepath, + dirname: _path().default.dirname(filepath), + options + }; +}); +const readIgnoreConfig = (0, _utils.makeStaticFileCache)((filepath, content) => { + const ignoreDir = _path().default.dirname(filepath); + + const ignorePatterns = content.split("\n").map(line => line.replace(/#(.*?)$/, "").trim()).filter(line => !!line); + + for (const pattern of ignorePatterns) { + if (pattern[0] === "!") { + throw new Error(`Negation of file paths is not supported.`); + } + } + + return { + filepath, + dirname: _path().default.dirname(filepath), + ignore: ignorePatterns.map(pattern => (0, _patternToRegex.default)(pattern, ignoreDir)) + }; +}); + +function* resolveShowConfigPath(dirname) { + const targetPath = process.env.BABEL_SHOW_CONFIG_FOR; + + if (targetPath != null) { + const absolutePath = _path().default.resolve(dirname, targetPath); + + const stats = yield* fs.stat(absolutePath); + + if (!stats.isFile()) { + throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`); + } + + return absolutePath; + } + + return null; +} + +function throwConfigError() { + throw new Error(`\ +Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured +for various types of caching, using the first param of their handler functions: + +module.exports = function(api) { + // The API exposes the following: + + // Cache the returned value forever and don't call this function again. + api.cache(true); + + // Don't cache at all. Not recommended because it will be very slow. + api.cache(false); + + // Cached based on the value of some function. If this function returns a value different from + // a previously-encountered value, the plugins will re-evaluate. + var env = api.cache(() => process.env.NODE_ENV); + + // If testing for a specific env, we recommend specifics to avoid instantiating a plugin for + // any possible NODE_ENV value that might come up during plugin execution. + var isProd = api.cache(() => process.env.NODE_ENV === "production"); + + // .cache(fn) will perform a linear search though instances to find the matching plugin based + // based on previous instantiated plugins. If you want to recreate the plugin and discard the + // previous instance whenever something changes, you may use: + var isProd = api.cache.invalidate(() => process.env.NODE_ENV === "production"); + + // Note, we also expose the following more-verbose versions of the above examples: + api.cache.forever(); // api.cache(true) + api.cache.never(); // api.cache(false) + api.cache.using(fn); // api.cache(fn) + + // Return the value that will be cached. + return { }; +};`); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/files/import.js b/tools/node_modules/@babel/core/lib/config/files/import.js new file mode 100644 index 00000000000000..c0acc2b666dbdc --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/files/import.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = import_; + +function import_(filepath) { + return import(filepath); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/files/index-browser.js b/tools/node_modules/@babel/core/lib/config/files/index-browser.js new file mode 100644 index 00000000000000..abe5fbd1bf088a --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/files/index-browser.js @@ -0,0 +1,68 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findConfigUpwards = findConfigUpwards; +exports.findPackageData = findPackageData; +exports.findRelativeConfig = findRelativeConfig; +exports.findRootConfig = findRootConfig; +exports.loadConfig = loadConfig; +exports.resolveShowConfigPath = resolveShowConfigPath; +exports.resolvePlugin = resolvePlugin; +exports.resolvePreset = resolvePreset; +exports.loadPlugin = loadPlugin; +exports.loadPreset = loadPreset; +exports.ROOT_CONFIG_FILENAMES = void 0; + +function* findConfigUpwards(rootDir) { + return null; +} + +function* findPackageData(filepath) { + return { + filepath, + directories: [], + pkg: null, + isPackage: false + }; +} + +function* findRelativeConfig(pkgData, envName, caller) { + return { + pkg: null, + config: null, + ignore: null + }; +} + +function* findRootConfig(dirname, envName, caller) { + return null; +} + +function* loadConfig(name, dirname, envName, caller) { + throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`); +} + +function* resolveShowConfigPath(dirname) { + return null; +} + +const ROOT_CONFIG_FILENAMES = []; +exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES; + +function resolvePlugin(name, dirname) { + return null; +} + +function resolvePreset(name, dirname) { + return null; +} + +function loadPlugin(name, dirname) { + throw new Error(`Cannot load plugin ${name} relative to ${dirname} in a browser`); +} + +function loadPreset(name, dirname) { + throw new Error(`Cannot load preset ${name} relative to ${dirname} in a browser`); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/files/index.js b/tools/node_modules/@babel/core/lib/config/files/index.js new file mode 100644 index 00000000000000..f75ace5ae9ab6a --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/files/index.js @@ -0,0 +1,79 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "findPackageData", { + enumerable: true, + get: function () { + return _package.findPackageData; + } +}); +Object.defineProperty(exports, "findConfigUpwards", { + enumerable: true, + get: function () { + return _configuration.findConfigUpwards; + } +}); +Object.defineProperty(exports, "findRelativeConfig", { + enumerable: true, + get: function () { + return _configuration.findRelativeConfig; + } +}); +Object.defineProperty(exports, "findRootConfig", { + enumerable: true, + get: function () { + return _configuration.findRootConfig; + } +}); +Object.defineProperty(exports, "loadConfig", { + enumerable: true, + get: function () { + return _configuration.loadConfig; + } +}); +Object.defineProperty(exports, "resolveShowConfigPath", { + enumerable: true, + get: function () { + return _configuration.resolveShowConfigPath; + } +}); +Object.defineProperty(exports, "ROOT_CONFIG_FILENAMES", { + enumerable: true, + get: function () { + return _configuration.ROOT_CONFIG_FILENAMES; + } +}); +Object.defineProperty(exports, "resolvePlugin", { + enumerable: true, + get: function () { + return _plugins.resolvePlugin; + } +}); +Object.defineProperty(exports, "resolvePreset", { + enumerable: true, + get: function () { + return _plugins.resolvePreset; + } +}); +Object.defineProperty(exports, "loadPlugin", { + enumerable: true, + get: function () { + return _plugins.loadPlugin; + } +}); +Object.defineProperty(exports, "loadPreset", { + enumerable: true, + get: function () { + return _plugins.loadPreset; + } +}); + +var _package = require("./package"); + +var _configuration = require("./configuration"); + +var _plugins = require("./plugins"); + +({}); \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/files/module-types.js b/tools/node_modules/@babel/core/lib/config/files/module-types.js new file mode 100644 index 00000000000000..6c17b8e374bf88 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/files/module-types.js @@ -0,0 +1,96 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = loadCjsOrMjsDefault; + +var _async = require("../../gensync-utils/async"); + +function _path() { + const data = _interopRequireDefault(require("path")); + + _path = function () { + return data; + }; + + return data; +} + +function _url() { + const data = require("url"); + + _url = function () { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } + +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } + +let import_; + +try { + import_ = require("./import").default; +} catch (_unused) {} + +function* loadCjsOrMjsDefault(filepath, asyncError) { + switch (guessJSModuleType(filepath)) { + case "cjs": + return loadCjsDefault(filepath); + + case "unknown": + try { + return loadCjsDefault(filepath); + } catch (e) { + if (e.code !== "ERR_REQUIRE_ESM") throw e; + } + + case "mjs": + if (yield* (0, _async.isAsync)()) { + return yield* (0, _async.waitFor)(loadMjsDefault(filepath)); + } + + throw new Error(asyncError); + } +} + +function guessJSModuleType(filename) { + switch (_path().default.extname(filename)) { + case ".cjs": + return "cjs"; + + case ".mjs": + return "mjs"; + + default: + return "unknown"; + } +} + +function loadCjsDefault(filepath) { + const module = require(filepath); + + return (module == null ? void 0 : module.__esModule) ? module.default || undefined : module; +} + +function loadMjsDefault(_x) { + return _loadMjsDefault.apply(this, arguments); +} + +function _loadMjsDefault() { + _loadMjsDefault = _asyncToGenerator(function* (filepath) { + if (!import_) { + throw new Error("Internal error: Native ECMAScript modules aren't supported" + " by this platform.\n"); + } + + const module = yield import_((0, _url().pathToFileURL)(filepath)); + return module.default; + }); + return _loadMjsDefault.apply(this, arguments); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/files/package.js b/tools/node_modules/@babel/core/lib/config/files/package.js new file mode 100644 index 00000000000000..095bc0e4a5f771 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/files/package.js @@ -0,0 +1,78 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findPackageData = findPackageData; + +function _path() { + const data = _interopRequireDefault(require("path")); + + _path = function () { + return data; + }; + + return data; +} + +var _utils = require("./utils"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const PACKAGE_FILENAME = "package.json"; + +function* findPackageData(filepath) { + let pkg = null; + const directories = []; + let isPackage = true; + + let dirname = _path().default.dirname(filepath); + + while (!pkg && _path().default.basename(dirname) !== "node_modules") { + directories.push(dirname); + pkg = yield* readConfigPackage(_path().default.join(dirname, PACKAGE_FILENAME)); + + const nextLoc = _path().default.dirname(dirname); + + if (dirname === nextLoc) { + isPackage = false; + break; + } + + dirname = nextLoc; + } + + return { + filepath, + directories, + pkg, + isPackage + }; +} + +const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => { + let options; + + try { + options = JSON.parse(content); + } catch (err) { + err.message = `${filepath}: Error while parsing JSON - ${err.message}`; + throw err; + } + + if (!options) throw new Error(`${filepath}: No config detected`); + + if (typeof options !== "object") { + throw new Error(`${filepath}: Config returned typeof ${typeof options}`); + } + + if (Array.isArray(options)) { + throw new Error(`${filepath}: Expected config object but found array`); + } + + return { + filepath, + dirname: _path().default.dirname(filepath), + options + }; +}); \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/files/plugins.js b/tools/node_modules/@babel/core/lib/config/files/plugins.js new file mode 100644 index 00000000000000..6b9cb715c88568 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/files/plugins.js @@ -0,0 +1,169 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.resolvePlugin = resolvePlugin; +exports.resolvePreset = resolvePreset; +exports.loadPlugin = loadPlugin; +exports.loadPreset = loadPreset; + +function _debug() { + const data = _interopRequireDefault(require("debug")); + + _debug = function () { + return data; + }; + + return data; +} + +function _resolve() { + const data = _interopRequireDefault(require("resolve")); + + _resolve = function () { + return data; + }; + + return data; +} + +function _path() { + const data = _interopRequireDefault(require("path")); + + _path = function () { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const debug = (0, _debug().default)("babel:config:loading:files:plugins"); +const EXACT_RE = /^module:/; +const BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/; +const BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/; +const BABEL_PLUGIN_ORG_RE = /^(@babel\/)(?!plugin-|[^/]+\/)/; +const BABEL_PRESET_ORG_RE = /^(@babel\/)(?!preset-|[^/]+\/)/; +const OTHER_PLUGIN_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/; +const OTHER_PRESET_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/; +const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/; + +function resolvePlugin(name, dirname) { + return resolveStandardizedName("plugin", name, dirname); +} + +function resolvePreset(name, dirname) { + return resolveStandardizedName("preset", name, dirname); +} + +function loadPlugin(name, dirname) { + const filepath = resolvePlugin(name, dirname); + + if (!filepath) { + throw new Error(`Plugin ${name} not found relative to ${dirname}`); + } + + const value = requireModule("plugin", filepath); + debug("Loaded plugin %o from %o.", name, dirname); + return { + filepath, + value + }; +} + +function loadPreset(name, dirname) { + const filepath = resolvePreset(name, dirname); + + if (!filepath) { + throw new Error(`Preset ${name} not found relative to ${dirname}`); + } + + const value = requireModule("preset", filepath); + debug("Loaded preset %o from %o.", name, dirname); + return { + filepath, + value + }; +} + +function standardizeName(type, name) { + if (_path().default.isAbsolute(name)) return name; + const isPreset = type === "preset"; + return name.replace(isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE, `babel-${type}-`).replace(isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE, `$1${type}-`).replace(isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE, `$1babel-${type}-`).replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`).replace(EXACT_RE, ""); +} + +function resolveStandardizedName(type, name, dirname = process.cwd()) { + const standardizedName = standardizeName(type, name); + + try { + return _resolve().default.sync(standardizedName, { + basedir: dirname + }); + } catch (e) { + if (e.code !== "MODULE_NOT_FOUND") throw e; + + if (standardizedName !== name) { + let resolvedOriginal = false; + + try { + _resolve().default.sync(name, { + basedir: dirname + }); + + resolvedOriginal = true; + } catch (_unused) {} + + if (resolvedOriginal) { + e.message += `\n- If you want to resolve "${name}", use "module:${name}"`; + } + } + + let resolvedBabel = false; + + try { + _resolve().default.sync(standardizeName(type, "@babel/" + name), { + basedir: dirname + }); + + resolvedBabel = true; + } catch (_unused2) {} + + if (resolvedBabel) { + e.message += `\n- Did you mean "@babel/${name}"?`; + } + + let resolvedOppositeType = false; + const oppositeType = type === "preset" ? "plugin" : "preset"; + + try { + _resolve().default.sync(standardizeName(oppositeType, name), { + basedir: dirname + }); + + resolvedOppositeType = true; + } catch (_unused3) {} + + if (resolvedOppositeType) { + e.message += `\n- Did you accidentally pass a ${oppositeType} as a ${type}?`; + } + + throw e; + } +} + +const LOADING_MODULES = new Set(); + +function requireModule(type, name) { + if (LOADING_MODULES.has(name)) { + throw new Error(`Reentrant ${type} detected trying to load "${name}". This module is not ignored ` + "and is trying to load itself while compiling itself, leading to a dependency cycle. " + 'We recommend adding it to your "ignore" list in your babelrc, or to a .babelignore.'); + } + + try { + LOADING_MODULES.add(name); + return require(name); + } finally { + LOADING_MODULES.delete(name); + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/files/types.js b/tools/node_modules/@babel/core/lib/config/files/types.js new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/tools/node_modules/@babel/core/lib/config/files/utils.js b/tools/node_modules/@babel/core/lib/config/files/utils.js new file mode 100644 index 00000000000000..0b08798146f7b8 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/files/utils.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.makeStaticFileCache = makeStaticFileCache; + +var _caching = require("../caching"); + +var fs = _interopRequireWildcard(require("../../gensync-utils/fs")); + +function _fs2() { + const data = _interopRequireDefault(require("fs")); + + _fs2 = function () { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function makeStaticFileCache(fn) { + return (0, _caching.makeStrongCache)(function* (filepath, cache) { + const cached = cache.invalidate(() => fileMtime(filepath)); + + if (cached === null) { + return null; + } + + return fn(filepath, yield* fs.readFile(filepath, "utf8")); + }); +} + +function fileMtime(filepath) { + try { + return +_fs2().default.statSync(filepath).mtime; + } catch (e) { + if (e.code !== "ENOENT" && e.code !== "ENOTDIR") throw e; + } + + return null; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/full.js b/tools/node_modules/@babel/core/lib/config/full.js new file mode 100644 index 00000000000000..d817a1581242af --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/full.js @@ -0,0 +1,329 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +var _async = require("../gensync-utils/async"); + +var _util = require("./util"); + +var context = _interopRequireWildcard(require("../index")); + +var _plugin = _interopRequireDefault(require("./plugin")); + +var _item = require("./item"); + +var _configChain = require("./config-chain"); + +function _traverse() { + const data = _interopRequireDefault(require("@babel/traverse")); + + _traverse = function () { + return data; + }; + + return data; +} + +var _caching = require("./caching"); + +var _options = require("./validation/options"); + +var _plugins = require("./validation/plugins"); + +var _configApi = _interopRequireDefault(require("./helpers/config-api")); + +var _partial = _interopRequireDefault(require("./partial")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _gensync().default)(function* loadFullConfig(inputOpts) { + const result = yield* (0, _partial.default)(inputOpts); + + if (!result) { + return null; + } + + const { + options, + context, + fileHandling + } = result; + + if (fileHandling === "ignored") { + return null; + } + + const optionDefaults = {}; + const { + plugins, + presets + } = options; + + if (!plugins || !presets) { + throw new Error("Assertion failure - plugins and presets exist"); + } + + const toDescriptor = item => { + const desc = (0, _item.getItemDescriptor)(item); + + if (!desc) { + throw new Error("Assertion failure - must be config item"); + } + + return desc; + }; + + const presetsDescriptors = presets.map(toDescriptor); + const initialPluginsDescriptors = plugins.map(toDescriptor); + const pluginDescriptorsByPass = [[]]; + const passes = []; + const ignored = yield* enhanceError(context, function* recursePresetDescriptors(rawPresets, pluginDescriptorsPass) { + const presets = []; + + for (let i = 0; i < rawPresets.length; i++) { + const descriptor = rawPresets[i]; + + if (descriptor.options !== false) { + try { + if (descriptor.ownPass) { + presets.push({ + preset: yield* loadPresetDescriptor(descriptor, context), + pass: [] + }); + } else { + presets.unshift({ + preset: yield* loadPresetDescriptor(descriptor, context), + pass: pluginDescriptorsPass + }); + } + } catch (e) { + if (e.code === "BABEL_UNKNOWN_OPTION") { + (0, _options.checkNoUnwrappedItemOptionPairs)(rawPresets, i, "preset", e); + } + + throw e; + } + } + } + + if (presets.length > 0) { + pluginDescriptorsByPass.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pluginDescriptorsPass)); + + for (const { + preset, + pass + } of presets) { + if (!preset) return true; + pass.push(...preset.plugins); + const ignored = yield* recursePresetDescriptors(preset.presets, pass); + if (ignored) return true; + preset.options.forEach(opts => { + (0, _util.mergeOptions)(optionDefaults, opts); + }); + } + } + })(presetsDescriptors, pluginDescriptorsByPass[0]); + if (ignored) return null; + const opts = optionDefaults; + (0, _util.mergeOptions)(opts, options); + yield* enhanceError(context, function* loadPluginDescriptors() { + pluginDescriptorsByPass[0].unshift(...initialPluginsDescriptors); + + for (const descs of pluginDescriptorsByPass) { + const pass = []; + passes.push(pass); + + for (let i = 0; i < descs.length; i++) { + const descriptor = descs[i]; + + if (descriptor.options !== false) { + try { + pass.push(yield* loadPluginDescriptor(descriptor, context)); + } catch (e) { + if (e.code === "BABEL_UNKNOWN_PLUGIN_PROPERTY") { + (0, _options.checkNoUnwrappedItemOptionPairs)(descs, i, "plugin", e); + } + + throw e; + } + } + } + } + })(); + opts.plugins = passes[0]; + opts.presets = passes.slice(1).filter(plugins => plugins.length > 0).map(plugins => ({ + plugins + })); + opts.passPerPreset = opts.presets.length > 0; + return { + options: opts, + passes: passes + }; +}); + +exports.default = _default; + +function enhanceError(context, fn) { + return function* (arg1, arg2) { + try { + return yield* fn(arg1, arg2); + } catch (e) { + if (!/^\[BABEL\]/.test(e.message)) { + e.message = `[BABEL] ${context.filename || "unknown"}: ${e.message}`; + } + + throw e; + } + }; +} + +const loadDescriptor = (0, _caching.makeWeakCache)(function* ({ + value, + options, + dirname, + alias +}, cache) { + if (options === false) throw new Error("Assertion failure"); + options = options || {}; + let item = value; + + if (typeof value === "function") { + const api = Object.assign({}, context, (0, _configApi.default)(cache)); + + try { + item = value(api, options, dirname); + } catch (e) { + if (alias) { + e.message += ` (While processing: ${JSON.stringify(alias)})`; + } + + throw e; + } + } + + if (!item || typeof item !== "object") { + throw new Error("Plugin/Preset did not return an object."); + } + + if (typeof item.then === "function") { + yield* []; + throw new Error(`You appear to be using an async plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`); + } + + return { + value: item, + options, + dirname, + alias + }; +}); + +function* loadPluginDescriptor(descriptor, context) { + if (descriptor.value instanceof _plugin.default) { + if (descriptor.options) { + throw new Error("Passed options to an existing Plugin instance will not work."); + } + + return descriptor.value; + } + + return yield* instantiatePlugin(yield* loadDescriptor(descriptor, context), context); +} + +const instantiatePlugin = (0, _caching.makeWeakCache)(function* ({ + value, + options, + dirname, + alias +}, cache) { + const pluginObj = (0, _plugins.validatePluginObject)(value); + const plugin = Object.assign({}, pluginObj); + + if (plugin.visitor) { + plugin.visitor = _traverse().default.explode(Object.assign({}, plugin.visitor)); + } + + if (plugin.inherits) { + const inheritsDescriptor = { + name: undefined, + alias: `${alias}$inherits`, + value: plugin.inherits, + options, + dirname + }; + const inherits = yield* (0, _async.forwardAsync)(loadPluginDescriptor, run => { + return cache.invalidate(data => run(inheritsDescriptor, data)); + }); + plugin.pre = chain(inherits.pre, plugin.pre); + plugin.post = chain(inherits.post, plugin.post); + plugin.manipulateOptions = chain(inherits.manipulateOptions, plugin.manipulateOptions); + plugin.visitor = _traverse().default.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]); + } + + return new _plugin.default(plugin, options, alias); +}); + +const validateIfOptionNeedsFilename = (options, descriptor) => { + if (options.test || options.include || options.exclude) { + const formattedPresetName = descriptor.name ? `"${descriptor.name}"` : "/* your preset */"; + throw new Error([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\`\`\``, `babel.transform(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\`\`\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join("\n")); + } +}; + +const validatePreset = (preset, context, descriptor) => { + if (!context.filename) { + const { + options + } = preset; + validateIfOptionNeedsFilename(options, descriptor); + + if (options.overrides) { + options.overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor)); + } + } +}; + +function* loadPresetDescriptor(descriptor, context) { + const preset = instantiatePreset(yield* loadDescriptor(descriptor, context)); + validatePreset(preset, context, descriptor); + return yield* (0, _configChain.buildPresetChain)(preset, context); +} + +const instantiatePreset = (0, _caching.makeWeakCacheSync)(({ + value, + dirname, + alias +}) => { + return { + options: (0, _options.validate)("preset", value), + alias, + dirname + }; +}); + +function chain(a, b) { + const fns = [a, b].filter(Boolean); + if (fns.length <= 1) return fns[0]; + return function (...args) { + for (const fn of fns) { + fn.apply(this, args); + } + }; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/helpers/config-api.js b/tools/node_modules/@babel/core/lib/config/helpers/config-api.js new file mode 100644 index 00000000000000..b94c05485863a4 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/helpers/config-api.js @@ -0,0 +1,85 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = makeAPI; + +function _semver() { + const data = _interopRequireDefault(require("semver")); + + _semver = function () { + return data; + }; + + return data; +} + +var _ = require("../../"); + +var _caching = require("../caching"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function makeAPI(cache) { + const env = value => cache.using(data => { + if (typeof value === "undefined") return data.envName; + + if (typeof value === "function") { + return (0, _caching.assertSimpleType)(value(data.envName)); + } + + if (!Array.isArray(value)) value = [value]; + return value.some(entry => { + if (typeof entry !== "string") { + throw new Error("Unexpected non-string value"); + } + + return entry === data.envName; + }); + }); + + const caller = cb => cache.using(data => (0, _caching.assertSimpleType)(cb(data.caller))); + + return { + version: _.version, + cache: cache.simple(), + env, + async: () => false, + caller, + assertVersion + }; +} + +function assertVersion(range) { + if (typeof range === "number") { + if (!Number.isInteger(range)) { + throw new Error("Expected string or integer value."); + } + + range = `^${range}.0.0-0`; + } + + if (typeof range !== "string") { + throw new Error("Expected string or integer value."); + } + + if (_semver().default.satisfies(_.version, range)) return; + const limit = Error.stackTraceLimit; + + if (typeof limit === "number" && limit < 25) { + Error.stackTraceLimit = 25; + } + + const err = new Error(`Requires Babel "${range}", but was loaded with "${_.version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`); + + if (typeof limit === "number") { + Error.stackTraceLimit = limit; + } + + throw Object.assign(err, { + code: "BABEL_VERSION_UNSUPPORTED", + version: _.version, + range + }); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/helpers/environment.js b/tools/node_modules/@babel/core/lib/config/helpers/environment.js new file mode 100644 index 00000000000000..e4bfdbc7a725cd --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/helpers/environment.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getEnv = getEnv; + +function getEnv(defaultValue = "development") { + return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/index.js b/tools/node_modules/@babel/core/lib/config/index.js new file mode 100644 index 00000000000000..9208224e071f65 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/index.js @@ -0,0 +1,57 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function () { + return _full.default; + } +}); +exports.loadOptionsAsync = exports.loadOptionsSync = exports.loadOptions = exports.loadPartialConfigAsync = exports.loadPartialConfigSync = exports.loadPartialConfig = void 0; + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +var _full = _interopRequireDefault(require("./full")); + +var _partial = require("./partial"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const loadOptionsRunner = (0, _gensync().default)(function* (opts) { + var _config$options; + + const config = yield* (0, _full.default)(opts); + return (_config$options = config == null ? void 0 : config.options) != null ? _config$options : null; +}); + +const maybeErrback = runner => (opts, callback) => { + if (callback === undefined && typeof opts === "function") { + callback = opts; + opts = undefined; + } + + return callback ? runner.errback(opts, callback) : runner.sync(opts); +}; + +const loadPartialConfig = maybeErrback(_partial.loadPartialConfig); +exports.loadPartialConfig = loadPartialConfig; +const loadPartialConfigSync = _partial.loadPartialConfig.sync; +exports.loadPartialConfigSync = loadPartialConfigSync; +const loadPartialConfigAsync = _partial.loadPartialConfig.async; +exports.loadPartialConfigAsync = loadPartialConfigAsync; +const loadOptions = maybeErrback(loadOptionsRunner); +exports.loadOptions = loadOptions; +const loadOptionsSync = loadOptionsRunner.sync; +exports.loadOptionsSync = loadOptionsSync; +const loadOptionsAsync = loadOptionsRunner.async; +exports.loadOptionsAsync = loadOptionsAsync; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/item.js b/tools/node_modules/@babel/core/lib/config/item.js new file mode 100644 index 00000000000000..b4962a0d6edff3 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/item.js @@ -0,0 +1,78 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createItemFromDescriptor = createItemFromDescriptor; +exports.createConfigItem = createConfigItem; +exports.getItemDescriptor = getItemDescriptor; + +function _path() { + const data = _interopRequireDefault(require("path")); + + _path = function () { + return data; + }; + + return data; +} + +var _configDescriptors = require("./config-descriptors"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function createItemFromDescriptor(desc) { + return new ConfigItem(desc); +} + +function createConfigItem(value, { + dirname = ".", + type +} = {}) { + const descriptor = (0, _configDescriptors.createDescriptor)(value, _path().default.resolve(dirname), { + type, + alias: "programmatic item" + }); + return createItemFromDescriptor(descriptor); +} + +function getItemDescriptor(item) { + if (item == null ? void 0 : item[CONFIG_ITEM_BRAND]) { + return item._descriptor; + } + + return undefined; +} + +const CONFIG_ITEM_BRAND = Symbol.for("@babel/core@7 - ConfigItem"); + +class ConfigItem { + constructor(descriptor) { + this._descriptor = void 0; + this[CONFIG_ITEM_BRAND] = true; + this.value = void 0; + this.options = void 0; + this.dirname = void 0; + this.name = void 0; + this.file = void 0; + this._descriptor = descriptor; + Object.defineProperty(this, "_descriptor", { + enumerable: false + }); + Object.defineProperty(this, CONFIG_ITEM_BRAND, { + enumerable: false + }); + this.value = this._descriptor.value; + this.options = this._descriptor.options; + this.dirname = this._descriptor.dirname; + this.name = this._descriptor.name; + this.file = this._descriptor.file ? { + request: this._descriptor.file.request, + resolved: this._descriptor.file.resolved + } : undefined; + Object.freeze(this); + } + +} + +Object.freeze(ConfigItem.prototype); \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/partial.js b/tools/node_modules/@babel/core/lib/config/partial.js new file mode 100644 index 00000000000000..229e06454e0896 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/partial.js @@ -0,0 +1,187 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = loadPrivatePartialConfig; +exports.loadPartialConfig = void 0; + +function _path() { + const data = _interopRequireDefault(require("path")); + + _path = function () { + return data; + }; + + return data; +} + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +var _plugin = _interopRequireDefault(require("./plugin")); + +var _util = require("./util"); + +var _item = require("./item"); + +var _configChain = require("./config-chain"); + +var _environment = require("./helpers/environment"); + +var _options = require("./validation/options"); + +var _files = require("./files"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function* resolveRootMode(rootDir, rootMode) { + switch (rootMode) { + case "root": + return rootDir; + + case "upward-optional": + { + const upwardRootDir = yield* (0, _files.findConfigUpwards)(rootDir); + return upwardRootDir === null ? rootDir : upwardRootDir; + } + + case "upward": + { + const upwardRootDir = yield* (0, _files.findConfigUpwards)(rootDir); + if (upwardRootDir !== null) return upwardRootDir; + throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}".\n` + `One of the following config files must be in the directory tree: ` + `"${_files.ROOT_CONFIG_FILENAMES.join(", ")}".`), { + code: "BABEL_ROOT_NOT_FOUND", + dirname: rootDir + }); + } + + default: + throw new Error(`Assertion failure - unknown rootMode value.`); + } +} + +function* loadPrivatePartialConfig(inputOpts) { + if (inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts))) { + throw new Error("Babel options must be an object, null, or undefined"); + } + + const args = inputOpts ? (0, _options.validate)("arguments", inputOpts) : {}; + const { + envName = (0, _environment.getEnv)(), + cwd = ".", + root: rootDir = ".", + rootMode = "root", + caller, + cloneInputAst = true + } = args; + + const absoluteCwd = _path().default.resolve(cwd); + + const absoluteRootDir = yield* resolveRootMode(_path().default.resolve(absoluteCwd, rootDir), rootMode); + const filename = typeof args.filename === "string" ? _path().default.resolve(cwd, args.filename) : undefined; + const showConfigPath = yield* (0, _files.resolveShowConfigPath)(absoluteCwd); + const context = { + filename, + cwd: absoluteCwd, + root: absoluteRootDir, + envName, + caller, + showConfig: showConfigPath === filename + }; + const configChain = yield* (0, _configChain.buildRootChain)(args, context); + if (!configChain) return null; + const options = {}; + configChain.options.forEach(opts => { + (0, _util.mergeOptions)(options, opts); + }); + options.cloneInputAst = cloneInputAst; + options.babelrc = false; + options.configFile = false; + options.passPerPreset = false; + options.envName = context.envName; + options.cwd = context.cwd; + options.root = context.root; + options.filename = typeof context.filename === "string" ? context.filename : undefined; + options.plugins = configChain.plugins.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor)); + options.presets = configChain.presets.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor)); + return { + options, + context, + fileHandling: configChain.fileHandling, + ignore: configChain.ignore, + babelrc: configChain.babelrc, + config: configChain.config, + files: configChain.files + }; +} + +const loadPartialConfig = (0, _gensync().default)(function* (opts) { + let showIgnoredFiles = false; + + if (typeof opts === "object" && opts !== null && !Array.isArray(opts)) { + var _opts = opts; + ({ + showIgnoredFiles + } = _opts); + opts = _objectWithoutPropertiesLoose(_opts, ["showIgnoredFiles"]); + _opts; + } + + const result = yield* loadPrivatePartialConfig(opts); + if (!result) return null; + const { + options, + babelrc, + ignore, + config, + fileHandling, + files + } = result; + + if (fileHandling === "ignored" && !showIgnoredFiles) { + return null; + } + + (options.plugins || []).forEach(item => { + if (item.value instanceof _plugin.default) { + throw new Error("Passing cached plugin instances is not supported in " + "babel.loadPartialConfig()"); + } + }); + return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined, fileHandling, files); +}); +exports.loadPartialConfig = loadPartialConfig; + +class PartialConfig { + constructor(options, babelrc, ignore, config, fileHandling, files) { + this.options = void 0; + this.babelrc = void 0; + this.babelignore = void 0; + this.config = void 0; + this.fileHandling = void 0; + this.files = void 0; + this.options = options; + this.babelignore = ignore; + this.babelrc = babelrc; + this.config = config; + this.fileHandling = fileHandling; + this.files = files; + Object.freeze(this); + } + + hasFilesystemConfig() { + return this.babelrc !== undefined || this.config !== undefined; + } + +} + +Object.freeze(PartialConfig.prototype); \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/pattern-to-regex.js b/tools/node_modules/@babel/core/lib/config/pattern-to-regex.js new file mode 100644 index 00000000000000..b80f4b6752a4da --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/pattern-to-regex.js @@ -0,0 +1,52 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = pathToPattern; + +function _path() { + const data = _interopRequireDefault(require("path")); + + _path = function () { + return data; + }; + + return data; +} + +function _escapeRegExp() { + const data = _interopRequireDefault(require("lodash/escapeRegExp")); + + _escapeRegExp = function () { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const sep = `\\${_path().default.sep}`; +const endSep = `(?:${sep}|$)`; +const substitution = `[^${sep}]+`; +const starPat = `(?:${substitution}${sep})`; +const starPatLast = `(?:${substitution}${endSep})`; +const starStarPat = `${starPat}*?`; +const starStarPatLast = `${starPat}*?${starPatLast}?`; + +function pathToPattern(pattern, dirname) { + const parts = _path().default.resolve(dirname, pattern).split(_path().default.sep); + + return new RegExp(["^", ...parts.map((part, i) => { + const last = i === parts.length - 1; + if (part === "**") return last ? starStarPatLast : starStarPat; + if (part === "*") return last ? starPatLast : starPat; + + if (part.indexOf("*.") === 0) { + return substitution + (0, _escapeRegExp().default)(part.slice(1)) + (last ? endSep : sep); + } + + return (0, _escapeRegExp().default)(part) + (last ? endSep : sep); + })].join("")); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/plugin.js b/tools/node_modules/@babel/core/lib/config/plugin.js new file mode 100644 index 00000000000000..9cb1656be3cd28 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/plugin.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +class Plugin { + constructor(plugin, options, key) { + this.key = void 0; + this.manipulateOptions = void 0; + this.post = void 0; + this.pre = void 0; + this.visitor = void 0; + this.parserOverride = void 0; + this.generatorOverride = void 0; + this.options = void 0; + this.key = plugin.name || key; + this.manipulateOptions = plugin.manipulateOptions; + this.post = plugin.post; + this.pre = plugin.pre; + this.visitor = plugin.visitor || {}; + this.parserOverride = plugin.parserOverride; + this.generatorOverride = plugin.generatorOverride; + this.options = options; + } + +} + +exports.default = Plugin; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/printer.js b/tools/node_modules/@babel/core/lib/config/printer.js new file mode 100644 index 00000000000000..b007aa4c968d89 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/printer.js @@ -0,0 +1,127 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ConfigPrinter = exports.ChainFormatter = void 0; +const ChainFormatter = { + Programmatic: 0, + Config: 1 +}; +exports.ChainFormatter = ChainFormatter; +const Formatter = { + title(type, callerName, filepath) { + let title = ""; + + if (type === ChainFormatter.Programmatic) { + title = "programmatic options"; + + if (callerName) { + title += " from " + callerName; + } + } else { + title = "config " + filepath; + } + + return title; + }, + + loc(index, envName) { + let loc = ""; + + if (index != null) { + loc += `.overrides[${index}]`; + } + + if (envName != null) { + loc += `.env["${envName}"]`; + } + + return loc; + }, + + optionsAndDescriptors(opt) { + const content = Object.assign({}, opt.options); + delete content.overrides; + delete content.env; + const pluginDescriptors = [...opt.plugins()]; + + if (pluginDescriptors.length) { + content.plugins = pluginDescriptors.map(d => descriptorToConfig(d)); + } + + const presetDescriptors = [...opt.presets()]; + + if (presetDescriptors.length) { + content.presets = [...presetDescriptors].map(d => descriptorToConfig(d)); + } + + return JSON.stringify(content, undefined, 2); + } + +}; + +function descriptorToConfig(d) { + var _d$file; + + let name = (_d$file = d.file) == null ? void 0 : _d$file.request; + + if (name == null) { + if (typeof d.value === "object") { + name = d.value; + } else if (typeof d.value === "function") { + name = `[Function: ${d.value.toString().substr(0, 50)} ... ]`; + } + } + + if (name == null) { + name = "[Unknown]"; + } + + if (d.options === undefined) { + return name; + } else if (d.name == null) { + return [name, d.options]; + } else { + return [name, d.options, d.name]; + } +} + +class ConfigPrinter { + constructor() { + this._stack = []; + } + + configure(enabled, type, { + callerName, + filepath + }) { + if (!enabled) return () => {}; + return (content, index, envName) => { + this._stack.push({ + type, + callerName, + filepath, + content, + index, + envName + }); + }; + } + + static format(config) { + let title = Formatter.title(config.type, config.callerName, config.filepath); + const loc = Formatter.loc(config.index, config.envName); + if (loc) title += ` ${loc}`; + const content = Formatter.optionsAndDescriptors(config.content); + return `${title}\n${content}`; + } + + output() { + if (this._stack.length === 0) return ""; + return this._stack.map(s => ConfigPrinter.format(s)).join("\n\n"); + } + +} + +exports.ConfigPrinter = ConfigPrinter; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/util.js b/tools/node_modules/@babel/core/lib/config/util.js new file mode 100644 index 00000000000000..5608fb9d20b647 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/util.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.mergeOptions = mergeOptions; +exports.isIterableIterator = isIterableIterator; + +function mergeOptions(target, source) { + for (const k of Object.keys(source)) { + if (k === "parserOpts" && source.parserOpts) { + const parserOpts = source.parserOpts; + const targetObj = target.parserOpts = target.parserOpts || {}; + mergeDefaultFields(targetObj, parserOpts); + } else if (k === "generatorOpts" && source.generatorOpts) { + const generatorOpts = source.generatorOpts; + const targetObj = target.generatorOpts = target.generatorOpts || {}; + mergeDefaultFields(targetObj, generatorOpts); + } else { + const val = source[k]; + if (val !== undefined) target[k] = val; + } + } +} + +function mergeDefaultFields(target, source) { + for (const k of Object.keys(source)) { + const val = source[k]; + if (val !== undefined) target[k] = val; + } +} + +function isIterableIterator(value) { + return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function"; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/validation/option-assertions.js b/tools/node_modules/@babel/core/lib/config/validation/option-assertions.js new file mode 100644 index 00000000000000..d339aad0827441 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/validation/option-assertions.js @@ -0,0 +1,268 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.msg = msg; +exports.access = access; +exports.assertRootMode = assertRootMode; +exports.assertSourceMaps = assertSourceMaps; +exports.assertCompact = assertCompact; +exports.assertSourceType = assertSourceType; +exports.assertCallerMetadata = assertCallerMetadata; +exports.assertInputSourceMap = assertInputSourceMap; +exports.assertString = assertString; +exports.assertFunction = assertFunction; +exports.assertBoolean = assertBoolean; +exports.assertObject = assertObject; +exports.assertArray = assertArray; +exports.assertIgnoreList = assertIgnoreList; +exports.assertConfigApplicableTest = assertConfigApplicableTest; +exports.assertConfigFileSearch = assertConfigFileSearch; +exports.assertBabelrcSearch = assertBabelrcSearch; +exports.assertPluginList = assertPluginList; + +function msg(loc) { + switch (loc.type) { + case "root": + return ``; + + case "env": + return `${msg(loc.parent)}.env["${loc.name}"]`; + + case "overrides": + return `${msg(loc.parent)}.overrides[${loc.index}]`; + + case "option": + return `${msg(loc.parent)}.${loc.name}`; + + case "access": + return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`; + + default: + throw new Error(`Assertion failure: Unknown type ${loc.type}`); + } +} + +function access(loc, name) { + return { + type: "access", + name, + parent: loc + }; +} + +function assertRootMode(loc, value) { + if (value !== undefined && value !== "root" && value !== "upward" && value !== "upward-optional") { + throw new Error(`${msg(loc)} must be a "root", "upward", "upward-optional" or undefined`); + } + + return value; +} + +function assertSourceMaps(loc, value) { + if (value !== undefined && typeof value !== "boolean" && value !== "inline" && value !== "both") { + throw new Error(`${msg(loc)} must be a boolean, "inline", "both", or undefined`); + } + + return value; +} + +function assertCompact(loc, value) { + if (value !== undefined && typeof value !== "boolean" && value !== "auto") { + throw new Error(`${msg(loc)} must be a boolean, "auto", or undefined`); + } + + return value; +} + +function assertSourceType(loc, value) { + if (value !== undefined && value !== "module" && value !== "script" && value !== "unambiguous") { + throw new Error(`${msg(loc)} must be "module", "script", "unambiguous", or undefined`); + } + + return value; +} + +function assertCallerMetadata(loc, value) { + const obj = assertObject(loc, value); + + if (obj) { + if (typeof obj["name"] !== "string") { + throw new Error(`${msg(loc)} set but does not contain "name" property string`); + } + + for (const prop of Object.keys(obj)) { + const propLoc = access(loc, prop); + const value = obj[prop]; + + if (value != null && typeof value !== "boolean" && typeof value !== "string" && typeof value !== "number") { + throw new Error(`${msg(propLoc)} must be null, undefined, a boolean, a string, or a number.`); + } + } + } + + return value; +} + +function assertInputSourceMap(loc, value) { + if (value !== undefined && typeof value !== "boolean" && (typeof value !== "object" || !value)) { + throw new Error(`${msg(loc)} must be a boolean, object, or undefined`); + } + + return value; +} + +function assertString(loc, value) { + if (value !== undefined && typeof value !== "string") { + throw new Error(`${msg(loc)} must be a string, or undefined`); + } + + return value; +} + +function assertFunction(loc, value) { + if (value !== undefined && typeof value !== "function") { + throw new Error(`${msg(loc)} must be a function, or undefined`); + } + + return value; +} + +function assertBoolean(loc, value) { + if (value !== undefined && typeof value !== "boolean") { + throw new Error(`${msg(loc)} must be a boolean, or undefined`); + } + + return value; +} + +function assertObject(loc, value) { + if (value !== undefined && (typeof value !== "object" || Array.isArray(value) || !value)) { + throw new Error(`${msg(loc)} must be an object, or undefined`); + } + + return value; +} + +function assertArray(loc, value) { + if (value != null && !Array.isArray(value)) { + throw new Error(`${msg(loc)} must be an array, or undefined`); + } + + return value; +} + +function assertIgnoreList(loc, value) { + const arr = assertArray(loc, value); + + if (arr) { + arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item)); + } + + return arr; +} + +function assertIgnoreItem(loc, value) { + if (typeof value !== "string" && typeof value !== "function" && !(value instanceof RegExp)) { + throw new Error(`${msg(loc)} must be an array of string/Function/RegExp values, or undefined`); + } + + return value; +} + +function assertConfigApplicableTest(loc, value) { + if (value === undefined) return value; + + if (Array.isArray(value)) { + value.forEach((item, i) => { + if (!checkValidTest(item)) { + throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`); + } + }); + } else if (!checkValidTest(value)) { + throw new Error(`${msg(loc)} must be a string/Function/RegExp, or an array of those`); + } + + return value; +} + +function checkValidTest(value) { + return typeof value === "string" || typeof value === "function" || value instanceof RegExp; +} + +function assertConfigFileSearch(loc, value) { + if (value !== undefined && typeof value !== "boolean" && typeof value !== "string") { + throw new Error(`${msg(loc)} must be a undefined, a boolean, a string, ` + `got ${JSON.stringify(value)}`); + } + + return value; +} + +function assertBabelrcSearch(loc, value) { + if (value === undefined || typeof value === "boolean") return value; + + if (Array.isArray(value)) { + value.forEach((item, i) => { + if (!checkValidTest(item)) { + throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`); + } + }); + } else if (!checkValidTest(value)) { + throw new Error(`${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` + `or an array of those, got ${JSON.stringify(value)}`); + } + + return value; +} + +function assertPluginList(loc, value) { + const arr = assertArray(loc, value); + + if (arr) { + arr.forEach((item, i) => assertPluginItem(access(loc, i), item)); + } + + return arr; +} + +function assertPluginItem(loc, value) { + if (Array.isArray(value)) { + if (value.length === 0) { + throw new Error(`${msg(loc)} must include an object`); + } + + if (value.length > 3) { + throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`); + } + + assertPluginTarget(access(loc, 0), value[0]); + + if (value.length > 1) { + const opts = value[1]; + + if (opts !== undefined && opts !== false && (typeof opts !== "object" || Array.isArray(opts) || opts === null)) { + throw new Error(`${msg(access(loc, 1))} must be an object, false, or undefined`); + } + } + + if (value.length === 3) { + const name = value[2]; + + if (name !== undefined && typeof name !== "string") { + throw new Error(`${msg(access(loc, 2))} must be a string, or undefined`); + } + } + } else { + assertPluginTarget(loc, value); + } + + return value; +} + +function assertPluginTarget(loc, value) { + if ((typeof value !== "object" || !value) && typeof value !== "string" && typeof value !== "function") { + throw new Error(`${msg(loc)} must be a string, object, function`); + } + + return value; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/validation/options.js b/tools/node_modules/@babel/core/lib/config/validation/options.js new file mode 100644 index 00000000000000..04fb8bf5b6c2b9 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/validation/options.js @@ -0,0 +1,201 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validate = validate; +exports.checkNoUnwrappedItemOptionPairs = checkNoUnwrappedItemOptionPairs; + +var _plugin = _interopRequireDefault(require("../plugin")); + +var _removed = _interopRequireDefault(require("./removed")); + +var _optionAssertions = require("./option-assertions"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const ROOT_VALIDATORS = { + cwd: _optionAssertions.assertString, + root: _optionAssertions.assertString, + rootMode: _optionAssertions.assertRootMode, + configFile: _optionAssertions.assertConfigFileSearch, + caller: _optionAssertions.assertCallerMetadata, + filename: _optionAssertions.assertString, + filenameRelative: _optionAssertions.assertString, + code: _optionAssertions.assertBoolean, + ast: _optionAssertions.assertBoolean, + cloneInputAst: _optionAssertions.assertBoolean, + envName: _optionAssertions.assertString +}; +const BABELRC_VALIDATORS = { + babelrc: _optionAssertions.assertBoolean, + babelrcRoots: _optionAssertions.assertBabelrcSearch +}; +const NONPRESET_VALIDATORS = { + extends: _optionAssertions.assertString, + ignore: _optionAssertions.assertIgnoreList, + only: _optionAssertions.assertIgnoreList +}; +const COMMON_VALIDATORS = { + inputSourceMap: _optionAssertions.assertInputSourceMap, + presets: _optionAssertions.assertPluginList, + plugins: _optionAssertions.assertPluginList, + passPerPreset: _optionAssertions.assertBoolean, + env: assertEnvSet, + overrides: assertOverridesList, + test: _optionAssertions.assertConfigApplicableTest, + include: _optionAssertions.assertConfigApplicableTest, + exclude: _optionAssertions.assertConfigApplicableTest, + retainLines: _optionAssertions.assertBoolean, + comments: _optionAssertions.assertBoolean, + shouldPrintComment: _optionAssertions.assertFunction, + compact: _optionAssertions.assertCompact, + minified: _optionAssertions.assertBoolean, + auxiliaryCommentBefore: _optionAssertions.assertString, + auxiliaryCommentAfter: _optionAssertions.assertString, + sourceType: _optionAssertions.assertSourceType, + wrapPluginVisitorMethod: _optionAssertions.assertFunction, + highlightCode: _optionAssertions.assertBoolean, + sourceMaps: _optionAssertions.assertSourceMaps, + sourceMap: _optionAssertions.assertSourceMaps, + sourceFileName: _optionAssertions.assertString, + sourceRoot: _optionAssertions.assertString, + getModuleId: _optionAssertions.assertFunction, + moduleRoot: _optionAssertions.assertString, + moduleIds: _optionAssertions.assertBoolean, + moduleId: _optionAssertions.assertString, + parserOpts: _optionAssertions.assertObject, + generatorOpts: _optionAssertions.assertObject +}; + +function getSource(loc) { + return loc.type === "root" ? loc.source : getSource(loc.parent); +} + +function validate(type, opts) { + return validateNested({ + type: "root", + source: type + }, opts); +} + +function validateNested(loc, opts) { + const type = getSource(loc); + assertNoDuplicateSourcemap(opts); + Object.keys(opts).forEach(key => { + const optLoc = { + type: "option", + name: key, + parent: loc + }; + + if (type === "preset" && NONPRESET_VALIDATORS[key]) { + throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in preset options`); + } + + if (type !== "arguments" && ROOT_VALIDATORS[key]) { + throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options`); + } + + if (type !== "arguments" && type !== "configfile" && BABELRC_VALIDATORS[key]) { + if (type === "babelrcfile" || type === "extendsfile") { + throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in .babelrc or "extends"ed files, only in root programmatic options, ` + `or babel.config.js/config file options`); + } + + throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options, or babel.config.js/config file options`); + } + + const validator = COMMON_VALIDATORS[key] || NONPRESET_VALIDATORS[key] || BABELRC_VALIDATORS[key] || ROOT_VALIDATORS[key] || throwUnknownError; + validator(optLoc, opts[key]); + }); + return opts; +} + +function throwUnknownError(loc) { + const key = loc.name; + + if (_removed.default[key]) { + const { + message, + version = 5 + } = _removed.default[key]; + throw new Error(`Using removed Babel ${version} option: ${(0, _optionAssertions.msg)(loc)} - ${message}`); + } else { + const unknownOptErr = new Error(`Unknown option: ${(0, _optionAssertions.msg)(loc)}. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.`); + unknownOptErr.code = "BABEL_UNKNOWN_OPTION"; + throw unknownOptErr; + } +} + +function has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +function assertNoDuplicateSourcemap(opts) { + if (has(opts, "sourceMap") && has(opts, "sourceMaps")) { + throw new Error(".sourceMap is an alias for .sourceMaps, cannot use both"); + } +} + +function assertEnvSet(loc, value) { + if (loc.parent.type === "env") { + throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside of another .env block`); + } + + const parent = loc.parent; + const obj = (0, _optionAssertions.assertObject)(loc, value); + + if (obj) { + for (const envName of Object.keys(obj)) { + const env = (0, _optionAssertions.assertObject)((0, _optionAssertions.access)(loc, envName), obj[envName]); + if (!env) continue; + const envLoc = { + type: "env", + name: envName, + parent + }; + validateNested(envLoc, env); + } + } + + return obj; +} + +function assertOverridesList(loc, value) { + if (loc.parent.type === "env") { + throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .env block`); + } + + if (loc.parent.type === "overrides") { + throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .overrides block`); + } + + const parent = loc.parent; + const arr = (0, _optionAssertions.assertArray)(loc, value); + + if (arr) { + for (const [index, item] of arr.entries()) { + const objLoc = (0, _optionAssertions.access)(loc, index); + const env = (0, _optionAssertions.assertObject)(objLoc, item); + if (!env) throw new Error(`${(0, _optionAssertions.msg)(objLoc)} must be an object`); + const overridesLoc = { + type: "overrides", + index, + parent + }; + validateNested(overridesLoc, env); + } + } + + return arr; +} + +function checkNoUnwrappedItemOptionPairs(items, index, type, e) { + if (index === 0) return; + const lastItem = items[index - 1]; + const thisItem = items[index]; + + if (lastItem.file && lastItem.options === undefined && typeof thisItem.value === "object") { + e.message += `\n- Maybe you meant to use\n` + `"${type}": [\n ["${lastItem.file.request}", ${JSON.stringify(thisItem.value, undefined, 2)}]\n]\n` + `To be a valid ${type}, its name and options should be wrapped in a pair of brackets`; + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/validation/plugins.js b/tools/node_modules/@babel/core/lib/config/validation/plugins.js new file mode 100644 index 00000000000000..a70cc676fab148 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/validation/plugins.js @@ -0,0 +1,71 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validatePluginObject = validatePluginObject; + +var _optionAssertions = require("./option-assertions"); + +const VALIDATORS = { + name: _optionAssertions.assertString, + manipulateOptions: _optionAssertions.assertFunction, + pre: _optionAssertions.assertFunction, + post: _optionAssertions.assertFunction, + inherits: _optionAssertions.assertFunction, + visitor: assertVisitorMap, + parserOverride: _optionAssertions.assertFunction, + generatorOverride: _optionAssertions.assertFunction +}; + +function assertVisitorMap(loc, value) { + const obj = (0, _optionAssertions.assertObject)(loc, value); + + if (obj) { + Object.keys(obj).forEach(prop => assertVisitorHandler(prop, obj[prop])); + + if (obj.enter || obj.exit) { + throw new Error(`${(0, _optionAssertions.msg)(loc)} cannot contain catch-all "enter" or "exit" handlers. Please target individual nodes.`); + } + } + + return obj; +} + +function assertVisitorHandler(key, value) { + if (value && typeof value === "object") { + Object.keys(value).forEach(handler => { + if (handler !== "enter" && handler !== "exit") { + throw new Error(`.visitor["${key}"] may only have .enter and/or .exit handlers.`); + } + }); + } else if (typeof value !== "function") { + throw new Error(`.visitor["${key}"] must be a function`); + } + + return value; +} + +function validatePluginObject(obj) { + const rootPath = { + type: "root", + source: "plugin" + }; + Object.keys(obj).forEach(key => { + const validator = VALIDATORS[key]; + + if (validator) { + const optLoc = { + type: "option", + name: key, + parent: rootPath + }; + validator(optLoc, obj[key]); + } else { + const invalidPluginPropertyError = new Error(`.${key} is not a valid Plugin property`); + invalidPluginPropertyError.code = "BABEL_UNKNOWN_PLUGIN_PROPERTY"; + throw invalidPluginPropertyError; + } + }); + return obj; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/config/validation/removed.js b/tools/node_modules/@babel/core/lib/config/validation/removed.js new file mode 100644 index 00000000000000..f0fcd7de391f9d --- /dev/null +++ b/tools/node_modules/@babel/core/lib/config/validation/removed.js @@ -0,0 +1,66 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _default = { + auxiliaryComment: { + message: "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`" + }, + blacklist: { + message: "Put the specific transforms you want in the `plugins` option" + }, + breakConfig: { + message: "This is not a necessary option in Babel 6" + }, + experimental: { + message: "Put the specific transforms you want in the `plugins` option" + }, + externalHelpers: { + message: "Use the `external-helpers` plugin instead. " + "Check out http://babeljs.io/docs/plugins/external-helpers/" + }, + extra: { + message: "" + }, + jsxPragma: { + message: "use the `pragma` option in the `react-jsx` plugin. " + "Check out http://babeljs.io/docs/plugins/transform-react-jsx/" + }, + loose: { + message: "Specify the `loose` option for the relevant plugin you are using " + "or use a preset that sets the option." + }, + metadataUsedHelpers: { + message: "Not required anymore as this is enabled by default" + }, + modules: { + message: "Use the corresponding module transform plugin in the `plugins` option. " + "Check out http://babeljs.io/docs/plugins/#modules" + }, + nonStandard: { + message: "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. " + "Also check out the react preset http://babeljs.io/docs/plugins/preset-react/" + }, + optional: { + message: "Put the specific transforms you want in the `plugins` option" + }, + sourceMapName: { + message: "The `sourceMapName` option has been removed because it makes more sense for the " + "tooling that calls Babel to assign `map.file` themselves." + }, + stage: { + message: "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets" + }, + whitelist: { + message: "Put the specific transforms you want in the `plugins` option" + }, + resolveModuleSource: { + version: 6, + message: "Use `babel-plugin-module-resolver@3`'s 'resolvePath' options" + }, + metadata: { + version: 6, + message: "Generated plugin metadata is always included in the output result" + }, + sourceMapTarget: { + version: 6, + message: "The `sourceMapTarget` option has been removed because it makes more sense for the tooling " + "that calls Babel to assign `map.file` themselves." + } +}; +exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/gensync-utils/async.js b/tools/node_modules/@babel/core/lib/gensync-utils/async.js new file mode 100644 index 00000000000000..36b777d52712a4 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/gensync-utils/async.js @@ -0,0 +1,89 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.maybeAsync = maybeAsync; +exports.forwardAsync = forwardAsync; +exports.isThenable = isThenable; +exports.waitFor = exports.onFirstPause = exports.isAsync = void 0; + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const id = x => x; + +const runGenerator = (0, _gensync().default)(function* (item) { + return yield* item; +}); +const isAsync = (0, _gensync().default)({ + sync: () => false, + errback: cb => cb(null, true) +}); +exports.isAsync = isAsync; + +function maybeAsync(fn, message) { + return (0, _gensync().default)({ + sync(...args) { + const result = fn.apply(this, args); + if (isThenable(result)) throw new Error(message); + return result; + }, + + async(...args) { + return Promise.resolve(fn.apply(this, args)); + } + + }); +} + +const withKind = (0, _gensync().default)({ + sync: cb => cb("sync"), + async: cb => cb("async") +}); + +function forwardAsync(action, cb) { + const g = (0, _gensync().default)(action); + return withKind(kind => { + const adapted = g[kind]; + return cb(adapted); + }); +} + +const onFirstPause = (0, _gensync().default)({ + name: "onFirstPause", + arity: 2, + sync: function (item) { + return runGenerator.sync(item); + }, + errback: function (item, firstPause, cb) { + let completed = false; + runGenerator.errback(item, (err, value) => { + completed = true; + cb(err, value); + }); + + if (!completed) { + firstPause(); + } + } +}); +exports.onFirstPause = onFirstPause; +const waitFor = (0, _gensync().default)({ + sync: id, + async: id +}); +exports.waitFor = waitFor; + +function isThenable(val) { + return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function"; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/gensync-utils/fs.js b/tools/node_modules/@babel/core/lib/gensync-utils/fs.js new file mode 100644 index 00000000000000..02f445387f63cc --- /dev/null +++ b/tools/node_modules/@babel/core/lib/gensync-utils/fs.js @@ -0,0 +1,53 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stat = exports.exists = exports.readFile = void 0; + +function _fs() { + const data = _interopRequireDefault(require("fs")); + + _fs = function () { + return data; + }; + + return data; +} + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const readFile = (0, _gensync().default)({ + sync: _fs().default.readFileSync, + errback: _fs().default.readFile +}); +exports.readFile = readFile; +const exists = (0, _gensync().default)({ + sync(path) { + try { + _fs().default.accessSync(path); + + return true; + } catch (_unused) { + return false; + } + }, + + errback: (path, cb) => _fs().default.access(path, undefined, err => cb(null, !err)) +}); +exports.exists = exists; +const stat = (0, _gensync().default)({ + sync: _fs().default.statSync, + errback: _fs().default.stat +}); +exports.stat = stat; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/gensync-utils/resolve.js b/tools/node_modules/@babel/core/lib/gensync-utils/resolve.js new file mode 100644 index 00000000000000..2ca39d7612d472 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/gensync-utils/resolve.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _resolve() { + const data = _interopRequireDefault(require("resolve")); + + _resolve = function () { + return data; + }; + + return data; +} + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _gensync().default)({ + sync: _resolve().default.sync, + errback: _resolve().default +}); + +exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/index.js b/tools/node_modules/@babel/core/lib/index.js new file mode 100644 index 00000000000000..ecd444e06d152f --- /dev/null +++ b/tools/node_modules/@babel/core/lib/index.js @@ -0,0 +1,266 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Plugin = Plugin; +Object.defineProperty(exports, "File", { + enumerable: true, + get: function () { + return _file.default; + } +}); +Object.defineProperty(exports, "buildExternalHelpers", { + enumerable: true, + get: function () { + return _buildExternalHelpers.default; + } +}); +Object.defineProperty(exports, "resolvePlugin", { + enumerable: true, + get: function () { + return _files.resolvePlugin; + } +}); +Object.defineProperty(exports, "resolvePreset", { + enumerable: true, + get: function () { + return _files.resolvePreset; + } +}); +Object.defineProperty(exports, "version", { + enumerable: true, + get: function () { + return _package.version; + } +}); +Object.defineProperty(exports, "getEnv", { + enumerable: true, + get: function () { + return _environment.getEnv; + } +}); +Object.defineProperty(exports, "tokTypes", { + enumerable: true, + get: function () { + return _parser().tokTypes; + } +}); +Object.defineProperty(exports, "traverse", { + enumerable: true, + get: function () { + return _traverse().default; + } +}); +Object.defineProperty(exports, "template", { + enumerable: true, + get: function () { + return _template().default; + } +}); +Object.defineProperty(exports, "createConfigItem", { + enumerable: true, + get: function () { + return _item.createConfigItem; + } +}); +Object.defineProperty(exports, "loadPartialConfig", { + enumerable: true, + get: function () { + return _config.loadPartialConfig; + } +}); +Object.defineProperty(exports, "loadPartialConfigSync", { + enumerable: true, + get: function () { + return _config.loadPartialConfigSync; + } +}); +Object.defineProperty(exports, "loadPartialConfigAsync", { + enumerable: true, + get: function () { + return _config.loadPartialConfigAsync; + } +}); +Object.defineProperty(exports, "loadOptions", { + enumerable: true, + get: function () { + return _config.loadOptions; + } +}); +Object.defineProperty(exports, "loadOptionsSync", { + enumerable: true, + get: function () { + return _config.loadOptionsSync; + } +}); +Object.defineProperty(exports, "loadOptionsAsync", { + enumerable: true, + get: function () { + return _config.loadOptionsAsync; + } +}); +Object.defineProperty(exports, "transform", { + enumerable: true, + get: function () { + return _transform.transform; + } +}); +Object.defineProperty(exports, "transformSync", { + enumerable: true, + get: function () { + return _transform.transformSync; + } +}); +Object.defineProperty(exports, "transformAsync", { + enumerable: true, + get: function () { + return _transform.transformAsync; + } +}); +Object.defineProperty(exports, "transformFile", { + enumerable: true, + get: function () { + return _transformFile.transformFile; + } +}); +Object.defineProperty(exports, "transformFileSync", { + enumerable: true, + get: function () { + return _transformFile.transformFileSync; + } +}); +Object.defineProperty(exports, "transformFileAsync", { + enumerable: true, + get: function () { + return _transformFile.transformFileAsync; + } +}); +Object.defineProperty(exports, "transformFromAst", { + enumerable: true, + get: function () { + return _transformAst.transformFromAst; + } +}); +Object.defineProperty(exports, "transformFromAstSync", { + enumerable: true, + get: function () { + return _transformAst.transformFromAstSync; + } +}); +Object.defineProperty(exports, "transformFromAstAsync", { + enumerable: true, + get: function () { + return _transformAst.transformFromAstAsync; + } +}); +Object.defineProperty(exports, "parse", { + enumerable: true, + get: function () { + return _parse.parse; + } +}); +Object.defineProperty(exports, "parseSync", { + enumerable: true, + get: function () { + return _parse.parseSync; + } +}); +Object.defineProperty(exports, "parseAsync", { + enumerable: true, + get: function () { + return _parse.parseAsync; + } +}); +exports.types = exports.OptionManager = exports.DEFAULT_EXTENSIONS = void 0; + +var _file = _interopRequireDefault(require("./transformation/file/file")); + +var _buildExternalHelpers = _interopRequireDefault(require("./tools/build-external-helpers")); + +var _files = require("./config/files"); + +var _package = require("../package.json"); + +var _environment = require("./config/helpers/environment"); + +function _types() { + const data = _interopRequireWildcard(require("@babel/types")); + + _types = function () { + return data; + }; + + return data; +} + +Object.defineProperty(exports, "types", { + enumerable: true, + get: function () { + return _types(); + } +}); + +function _parser() { + const data = require("@babel/parser"); + + _parser = function () { + return data; + }; + + return data; +} + +function _traverse() { + const data = _interopRequireDefault(require("@babel/traverse")); + + _traverse = function () { + return data; + }; + + return data; +} + +function _template() { + const data = _interopRequireDefault(require("@babel/template")); + + _template = function () { + return data; + }; + + return data; +} + +var _item = require("./config/item"); + +var _config = require("./config"); + +var _transform = require("./transform"); + +var _transformFile = require("./transform-file"); + +var _transformAst = require("./transform-ast"); + +var _parse = require("./parse"); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs"]); +exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS; + +class OptionManager { + init(opts) { + return (0, _config.loadOptions)(opts); + } + +} + +exports.OptionManager = OptionManager; + +function Plugin(alias) { + throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/parse.js b/tools/node_modules/@babel/core/lib/parse.js new file mode 100644 index 00000000000000..e6c2d26620c4c1 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/parse.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseAsync = exports.parseSync = exports.parse = void 0; + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +var _config = _interopRequireDefault(require("./config")); + +var _parser = _interopRequireDefault(require("./parser")); + +var _normalizeOpts = _interopRequireDefault(require("./transformation/normalize-opts")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const parseRunner = (0, _gensync().default)(function* parse(code, opts) { + const config = yield* (0, _config.default)(opts); + + if (config === null) { + return null; + } + + return yield* (0, _parser.default)(config.passes, (0, _normalizeOpts.default)(config), code); +}); + +const parse = function parse(code, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = undefined; + } + + if (callback === undefined) return parseRunner.sync(code, opts); + parseRunner.errback(code, opts, callback); +}; + +exports.parse = parse; +const parseSync = parseRunner.sync; +exports.parseSync = parseSync; +const parseAsync = parseRunner.async; +exports.parseAsync = parseAsync; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/parser/index.js b/tools/node_modules/@babel/core/lib/parser/index.js new file mode 100644 index 00000000000000..e8fcc7fe4ac4ff --- /dev/null +++ b/tools/node_modules/@babel/core/lib/parser/index.js @@ -0,0 +1,97 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = parser; + +function _parser() { + const data = require("@babel/parser"); + + _parser = function () { + return data; + }; + + return data; +} + +function _codeFrame() { + const data = require("@babel/code-frame"); + + _codeFrame = function () { + return data; + }; + + return data; +} + +var _missingPluginHelper = _interopRequireDefault(require("./util/missing-plugin-helper")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function* parser(pluginPasses, { + parserOpts, + highlightCode = true, + filename = "unknown" +}, code) { + try { + const results = []; + + for (const plugins of pluginPasses) { + for (const plugin of plugins) { + const { + parserOverride + } = plugin; + + if (parserOverride) { + const ast = parserOverride(code, parserOpts, _parser().parse); + if (ast !== undefined) results.push(ast); + } + } + } + + if (results.length === 0) { + return (0, _parser().parse)(code, parserOpts); + } else if (results.length === 1) { + yield* []; + + if (typeof results[0].then === "function") { + throw new Error(`You appear to be using an async parser plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`); + } + + return results[0]; + } + + throw new Error("More than one plugin attempted to override parsing."); + } catch (err) { + if (err.code === "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED") { + err.message += "\nConsider renaming the file to '.mjs', or setting sourceType:module " + "or sourceType:unambiguous in your Babel config for this file."; + } + + const { + loc, + missingPlugin + } = err; + + if (loc) { + const codeFrame = (0, _codeFrame().codeFrameColumns)(code, { + start: { + line: loc.line, + column: loc.column + 1 + } + }, { + highlightCode + }); + + if (missingPlugin) { + err.message = `${filename}: ` + (0, _missingPluginHelper.default)(missingPlugin[0], loc, codeFrame); + } else { + err.message = `${filename}: ${err.message}\n\n` + codeFrame; + } + + err.code = "BABEL_PARSE_ERROR"; + } + + throw err; + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js b/tools/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js new file mode 100644 index 00000000000000..79897587a3b9e0 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js @@ -0,0 +1,307 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = generateMissingPluginMessage; +const pluginNameMap = { + classProperties: { + syntax: { + name: "@babel/plugin-syntax-class-properties", + url: "https://git.io/vb4yQ" + }, + transform: { + name: "@babel/plugin-proposal-class-properties", + url: "https://git.io/vb4SL" + } + }, + classPrivateProperties: { + syntax: { + name: "@babel/plugin-syntax-class-properties", + url: "https://git.io/vb4yQ" + }, + transform: { + name: "@babel/plugin-proposal-class-properties", + url: "https://git.io/vb4SL" + } + }, + classPrivateMethods: { + syntax: { + name: "@babel/plugin-syntax-class-properties", + url: "https://git.io/vb4yQ" + }, + transform: { + name: "@babel/plugin-proposal-private-methods", + url: "https://git.io/JvpRG" + } + }, + classStaticBlock: { + syntax: { + name: "@babel/plugin-syntax-class-static-block", + url: "https://git.io/JTLB6" + }, + transform: { + name: "@babel/plugin-proposal-class-static-block", + url: "https://git.io/JTLBP" + } + }, + decimal: { + syntax: { + name: "@babel/plugin-syntax-decimal", + url: "https://git.io/JfKOH" + } + }, + decorators: { + syntax: { + name: "@babel/plugin-syntax-decorators", + url: "https://git.io/vb4y9" + }, + transform: { + name: "@babel/plugin-proposal-decorators", + url: "https://git.io/vb4ST" + } + }, + doExpressions: { + syntax: { + name: "@babel/plugin-syntax-do-expressions", + url: "https://git.io/vb4yh" + }, + transform: { + name: "@babel/plugin-proposal-do-expressions", + url: "https://git.io/vb4S3" + } + }, + dynamicImport: { + syntax: { + name: "@babel/plugin-syntax-dynamic-import", + url: "https://git.io/vb4Sv" + } + }, + exportDefaultFrom: { + syntax: { + name: "@babel/plugin-syntax-export-default-from", + url: "https://git.io/vb4SO" + }, + transform: { + name: "@babel/plugin-proposal-export-default-from", + url: "https://git.io/vb4yH" + } + }, + exportNamespaceFrom: { + syntax: { + name: "@babel/plugin-syntax-export-namespace-from", + url: "https://git.io/vb4Sf" + }, + transform: { + name: "@babel/plugin-proposal-export-namespace-from", + url: "https://git.io/vb4SG" + } + }, + flow: { + syntax: { + name: "@babel/plugin-syntax-flow", + url: "https://git.io/vb4yb" + }, + transform: { + name: "@babel/preset-flow", + url: "https://git.io/JfeDn" + } + }, + functionBind: { + syntax: { + name: "@babel/plugin-syntax-function-bind", + url: "https://git.io/vb4y7" + }, + transform: { + name: "@babel/plugin-proposal-function-bind", + url: "https://git.io/vb4St" + } + }, + functionSent: { + syntax: { + name: "@babel/plugin-syntax-function-sent", + url: "https://git.io/vb4yN" + }, + transform: { + name: "@babel/plugin-proposal-function-sent", + url: "https://git.io/vb4SZ" + } + }, + importMeta: { + syntax: { + name: "@babel/plugin-syntax-import-meta", + url: "https://git.io/vbKK6" + } + }, + jsx: { + syntax: { + name: "@babel/plugin-syntax-jsx", + url: "https://git.io/vb4yA" + }, + transform: { + name: "@babel/preset-react", + url: "https://git.io/JfeDR" + } + }, + importAssertions: { + syntax: { + name: "@babel/plugin-syntax-import-assertions", + url: "https://git.io/JUbkv" + } + }, + moduleStringNames: { + syntax: { + name: "@babel/plugin-syntax-module-string-names", + url: "https://git.io/JTL8G" + } + }, + numericSeparator: { + syntax: { + name: "@babel/plugin-syntax-numeric-separator", + url: "https://git.io/vb4Sq" + }, + transform: { + name: "@babel/plugin-proposal-numeric-separator", + url: "https://git.io/vb4yS" + } + }, + optionalChaining: { + syntax: { + name: "@babel/plugin-syntax-optional-chaining", + url: "https://git.io/vb4Sc" + }, + transform: { + name: "@babel/plugin-proposal-optional-chaining", + url: "https://git.io/vb4Sk" + } + }, + pipelineOperator: { + syntax: { + name: "@babel/plugin-syntax-pipeline-operator", + url: "https://git.io/vb4yj" + }, + transform: { + name: "@babel/plugin-proposal-pipeline-operator", + url: "https://git.io/vb4SU" + } + }, + privateIn: { + syntax: { + name: "@babel/plugin-syntax-private-property-in-object", + url: "https://git.io/JfK3q" + }, + transform: { + name: "@babel/plugin-proposal-private-property-in-object", + url: "https://git.io/JfK3O" + } + }, + recordAndTuple: { + syntax: { + name: "@babel/plugin-syntax-record-and-tuple", + url: "https://git.io/JvKp3" + } + }, + throwExpressions: { + syntax: { + name: "@babel/plugin-syntax-throw-expressions", + url: "https://git.io/vb4SJ" + }, + transform: { + name: "@babel/plugin-proposal-throw-expressions", + url: "https://git.io/vb4yF" + } + }, + typescript: { + syntax: { + name: "@babel/plugin-syntax-typescript", + url: "https://git.io/vb4SC" + }, + transform: { + name: "@babel/preset-typescript", + url: "https://git.io/JfeDz" + } + }, + asyncGenerators: { + syntax: { + name: "@babel/plugin-syntax-async-generators", + url: "https://git.io/vb4SY" + }, + transform: { + name: "@babel/plugin-proposal-async-generator-functions", + url: "https://git.io/vb4yp" + } + }, + logicalAssignment: { + syntax: { + name: "@babel/plugin-syntax-logical-assignment-operators", + url: "https://git.io/vAlBp" + }, + transform: { + name: "@babel/plugin-proposal-logical-assignment-operators", + url: "https://git.io/vAlRe" + } + }, + nullishCoalescingOperator: { + syntax: { + name: "@babel/plugin-syntax-nullish-coalescing-operator", + url: "https://git.io/vb4yx" + }, + transform: { + name: "@babel/plugin-proposal-nullish-coalescing-operator", + url: "https://git.io/vb4Se" + } + }, + objectRestSpread: { + syntax: { + name: "@babel/plugin-syntax-object-rest-spread", + url: "https://git.io/vb4y5" + }, + transform: { + name: "@babel/plugin-proposal-object-rest-spread", + url: "https://git.io/vb4Ss" + } + }, + optionalCatchBinding: { + syntax: { + name: "@babel/plugin-syntax-optional-catch-binding", + url: "https://git.io/vb4Sn" + }, + transform: { + name: "@babel/plugin-proposal-optional-catch-binding", + url: "https://git.io/vb4SI" + } + } +}; +pluginNameMap.privateIn.syntax = pluginNameMap.privateIn.transform; + +const getNameURLCombination = ({ + name, + url +}) => `${name} (${url})`; + +function generateMissingPluginMessage(missingPluginName, loc, codeFrame) { + let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\n\n` + codeFrame; + const pluginInfo = pluginNameMap[missingPluginName]; + + if (pluginInfo) { + const { + syntax: syntaxPlugin, + transform: transformPlugin + } = pluginInfo; + + if (syntaxPlugin) { + const syntaxPluginInfo = getNameURLCombination(syntaxPlugin); + + if (transformPlugin) { + const transformPluginInfo = getNameURLCombination(transformPlugin); + const sectionType = transformPlugin.name.startsWith("@babel/plugin") ? "plugins" : "presets"; + helpMessage += `\n\nAdd ${transformPluginInfo} to the '${sectionType}' section of your Babel config to enable transformation. +If you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section to enable parsing.`; + } else { + helpMessage += `\n\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` + `to enable parsing.`; + } + } + } + + return helpMessage; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/tools/build-external-helpers.js b/tools/node_modules/@babel/core/lib/tools/build-external-helpers.js new file mode 100644 index 00000000000000..f30372eaf04105 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/tools/build-external-helpers.js @@ -0,0 +1,148 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; + +function helpers() { + const data = _interopRequireWildcard(require("@babel/helpers")); + + helpers = function () { + return data; + }; + + return data; +} + +function _generator() { + const data = _interopRequireDefault(require("@babel/generator")); + + _generator = function () { + return data; + }; + + return data; +} + +function _template() { + const data = _interopRequireDefault(require("@babel/template")); + + _template = function () { + return data; + }; + + return data; +} + +function t() { + const data = _interopRequireWildcard(require("@babel/types")); + + t = function () { + return data; + }; + + return data; +} + +var _file = _interopRequireDefault(require("../transformation/file/file")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +const buildUmdWrapper = replacements => (0, _template().default)` + (function (root, factory) { + if (typeof define === "function" && define.amd) { + define(AMD_ARGUMENTS, factory); + } else if (typeof exports === "object") { + factory(COMMON_ARGUMENTS); + } else { + factory(BROWSER_ARGUMENTS); + } + })(UMD_ROOT, function (FACTORY_PARAMETERS) { + FACTORY_BODY + }); + `(replacements); + +function buildGlobal(allowlist) { + const namespace = t().identifier("babelHelpers"); + const body = []; + const container = t().functionExpression(null, [t().identifier("global")], t().blockStatement(body)); + const tree = t().program([t().expressionStatement(t().callExpression(container, [t().conditionalExpression(t().binaryExpression("===", t().unaryExpression("typeof", t().identifier("global")), t().stringLiteral("undefined")), t().identifier("self"), t().identifier("global"))]))]); + body.push(t().variableDeclaration("var", [t().variableDeclarator(namespace, t().assignmentExpression("=", t().memberExpression(t().identifier("global"), namespace), t().objectExpression([])))])); + buildHelpers(body, namespace, allowlist); + return tree; +} + +function buildModule(allowlist) { + const body = []; + const refs = buildHelpers(body, null, allowlist); + body.unshift(t().exportNamedDeclaration(null, Object.keys(refs).map(name => { + return t().exportSpecifier(t().cloneNode(refs[name]), t().identifier(name)); + }))); + return t().program(body, [], "module"); +} + +function buildUmd(allowlist) { + const namespace = t().identifier("babelHelpers"); + const body = []; + body.push(t().variableDeclaration("var", [t().variableDeclarator(namespace, t().identifier("global"))])); + buildHelpers(body, namespace, allowlist); + return t().program([buildUmdWrapper({ + FACTORY_PARAMETERS: t().identifier("global"), + BROWSER_ARGUMENTS: t().assignmentExpression("=", t().memberExpression(t().identifier("root"), namespace), t().objectExpression([])), + COMMON_ARGUMENTS: t().identifier("exports"), + AMD_ARGUMENTS: t().arrayExpression([t().stringLiteral("exports")]), + FACTORY_BODY: body, + UMD_ROOT: t().identifier("this") + })]); +} + +function buildVar(allowlist) { + const namespace = t().identifier("babelHelpers"); + const body = []; + body.push(t().variableDeclaration("var", [t().variableDeclarator(namespace, t().objectExpression([]))])); + const tree = t().program(body); + buildHelpers(body, namespace, allowlist); + body.push(t().expressionStatement(namespace)); + return tree; +} + +function buildHelpers(body, namespace, allowlist) { + const getHelperReference = name => { + return namespace ? t().memberExpression(namespace, t().identifier(name)) : t().identifier(`_${name}`); + }; + + const refs = {}; + helpers().list.forEach(function (name) { + if (allowlist && allowlist.indexOf(name) < 0) return; + const ref = refs[name] = getHelperReference(name); + helpers().ensure(name, _file.default); + const { + nodes + } = helpers().get(name, getHelperReference, ref); + body.push(...nodes); + }); + return refs; +} + +function _default(allowlist, outputType = "global") { + let tree; + const build = { + global: buildGlobal, + module: buildModule, + umd: buildUmd, + var: buildVar + }[outputType]; + + if (build) { + tree = build(allowlist); + } else { + throw new Error(`Unsupported output type ${outputType}`); + } + + return (0, _generator().default)(tree).code; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transform-ast.js b/tools/node_modules/@babel/core/lib/transform-ast.js new file mode 100644 index 00000000000000..e43bf027874660 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transform-ast.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transformFromAstAsync = exports.transformFromAstSync = exports.transformFromAst = void 0; + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +var _config = _interopRequireDefault(require("./config")); + +var _transformation = require("./transformation"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const transformFromAstRunner = (0, _gensync().default)(function* (ast, code, opts) { + const config = yield* (0, _config.default)(opts); + if (config === null) return null; + if (!ast) throw new Error("No AST given"); + return yield* (0, _transformation.run)(config, code, ast); +}); + +const transformFromAst = function transformFromAst(ast, code, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = undefined; + } + + if (callback === undefined) { + return transformFromAstRunner.sync(ast, code, opts); + } + + transformFromAstRunner.errback(ast, code, opts, callback); +}; + +exports.transformFromAst = transformFromAst; +const transformFromAstSync = transformFromAstRunner.sync; +exports.transformFromAstSync = transformFromAstSync; +const transformFromAstAsync = transformFromAstRunner.async; +exports.transformFromAstAsync = transformFromAstAsync; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transform-file-browser.js b/tools/node_modules/@babel/core/lib/transform-file-browser.js new file mode 100644 index 00000000000000..6442c9821ff8ad --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transform-file-browser.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transformFileSync = transformFileSync; +exports.transformFileAsync = transformFileAsync; +exports.transformFile = void 0; + +const transformFile = function transformFile(filename, opts, callback) { + if (typeof opts === "function") { + callback = opts; + } + + callback(new Error("Transforming files is not supported in browsers"), null); +}; + +exports.transformFile = transformFile; + +function transformFileSync() { + throw new Error("Transforming files is not supported in browsers"); +} + +function transformFileAsync() { + return Promise.reject(new Error("Transforming files is not supported in browsers")); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transform-file.js b/tools/node_modules/@babel/core/lib/transform-file.js new file mode 100644 index 00000000000000..df376d78e3526e --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transform-file.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transformFileAsync = exports.transformFileSync = exports.transformFile = void 0; + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +var _config = _interopRequireDefault(require("./config")); + +var _transformation = require("./transformation"); + +var fs = _interopRequireWildcard(require("./gensync-utils/fs")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +({}); +const transformFileRunner = (0, _gensync().default)(function* (filename, opts) { + const options = Object.assign({}, opts, { + filename + }); + const config = yield* (0, _config.default)(options); + if (config === null) return null; + const code = yield* fs.readFile(filename, "utf8"); + return yield* (0, _transformation.run)(config, code); +}); +const transformFile = transformFileRunner.errback; +exports.transformFile = transformFile; +const transformFileSync = transformFileRunner.sync; +exports.transformFileSync = transformFileSync; +const transformFileAsync = transformFileRunner.async; +exports.transformFileAsync = transformFileAsync; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transform.js b/tools/node_modules/@babel/core/lib/transform.js new file mode 100644 index 00000000000000..32d4de7830d4a4 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transform.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transformAsync = exports.transformSync = exports.transform = void 0; + +function _gensync() { + const data = _interopRequireDefault(require("gensync")); + + _gensync = function () { + return data; + }; + + return data; +} + +var _config = _interopRequireDefault(require("./config")); + +var _transformation = require("./transformation"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const transformRunner = (0, _gensync().default)(function* transform(code, opts) { + const config = yield* (0, _config.default)(opts); + if (config === null) return null; + return yield* (0, _transformation.run)(config, code); +}); + +const transform = function transform(code, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = undefined; + } + + if (callback === undefined) return transformRunner.sync(code, opts); + transformRunner.errback(code, opts, callback); +}; + +exports.transform = transform; +const transformSync = transformRunner.sync; +exports.transformSync = transformSync; +const transformAsync = transformRunner.async; +exports.transformAsync = transformAsync; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js b/tools/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js new file mode 100644 index 00000000000000..55eb06dfeb5228 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js @@ -0,0 +1,68 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = loadBlockHoistPlugin; + +function _sortBy() { + const data = _interopRequireDefault(require("lodash/sortBy")); + + _sortBy = function () { + return data; + }; + + return data; +} + +var _config = _interopRequireDefault(require("../config")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +let LOADED_PLUGIN; + +function loadBlockHoistPlugin() { + if (!LOADED_PLUGIN) { + const config = _config.default.sync({ + babelrc: false, + configFile: false, + plugins: [blockHoistPlugin] + }); + + LOADED_PLUGIN = config ? config.passes[0][0] : undefined; + if (!LOADED_PLUGIN) throw new Error("Assertion failure"); + } + + return LOADED_PLUGIN; +} + +const blockHoistPlugin = { + name: "internal.blockHoist", + visitor: { + Block: { + exit({ + node + }) { + let hasChange = false; + + for (let i = 0; i < node.body.length; i++) { + const bodyNode = node.body[i]; + + if ((bodyNode == null ? void 0 : bodyNode._blockHoist) != null) { + hasChange = true; + break; + } + } + + if (!hasChange) return; + node.body = (0, _sortBy().default)(node.body, function (bodyNode) { + let priority = bodyNode == null ? void 0 : bodyNode._blockHoist; + if (priority == null) priority = 1; + if (priority === true) priority = 2; + return -1 * priority; + }); + } + + } + } +}; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transformation/file/file.js b/tools/node_modules/@babel/core/lib/transformation/file/file.js new file mode 100644 index 00000000000000..83f636684d84e3 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transformation/file/file.js @@ -0,0 +1,255 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function helpers() { + const data = _interopRequireWildcard(require("@babel/helpers")); + + helpers = function () { + return data; + }; + + return data; +} + +function _traverse() { + const data = _interopRequireWildcard(require("@babel/traverse")); + + _traverse = function () { + return data; + }; + + return data; +} + +function _codeFrame() { + const data = require("@babel/code-frame"); + + _codeFrame = function () { + return data; + }; + + return data; +} + +function t() { + const data = _interopRequireWildcard(require("@babel/types")); + + t = function () { + return data; + }; + + return data; +} + +function _helperModuleTransforms() { + const data = require("@babel/helper-module-transforms"); + + _helperModuleTransforms = function () { + return data; + }; + + return data; +} + +function _semver() { + const data = _interopRequireDefault(require("semver")); + + _semver = function () { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +const errorVisitor = { + enter(path, state) { + const loc = path.node.loc; + + if (loc) { + state.loc = loc; + path.stop(); + } + } + +}; + +class File { + constructor(options, { + code, + ast, + inputMap + }) { + this._map = new Map(); + this.opts = void 0; + this.declarations = {}; + this.path = null; + this.ast = {}; + this.scope = void 0; + this.metadata = {}; + this.code = ""; + this.inputMap = null; + this.hub = { + file: this, + getCode: () => this.code, + getScope: () => this.scope, + addHelper: this.addHelper.bind(this), + buildError: this.buildCodeFrameError.bind(this) + }; + this.opts = options; + this.code = code; + this.ast = ast; + this.inputMap = inputMap; + this.path = _traverse().NodePath.get({ + hub: this.hub, + parentPath: null, + parent: this.ast, + container: this.ast, + key: "program" + }).setContext(); + this.scope = this.path.scope; + } + + get shebang() { + const { + interpreter + } = this.path.node; + return interpreter ? interpreter.value : ""; + } + + set shebang(value) { + if (value) { + this.path.get("interpreter").replaceWith(t().interpreterDirective(value)); + } else { + this.path.get("interpreter").remove(); + } + } + + set(key, val) { + if (key === "helpersNamespace") { + throw new Error("Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility." + "If you are using @babel/plugin-external-helpers you will need to use a newer " + "version than the one you currently have installed. " + "If you have your own implementation, you'll want to explore using 'helperGenerator' " + "alongside 'file.availableHelper()'."); + } + + this._map.set(key, val); + } + + get(key) { + return this._map.get(key); + } + + has(key) { + return this._map.has(key); + } + + getModuleName() { + return (0, _helperModuleTransforms().getModuleName)(this.opts, this.opts); + } + + addImport() { + throw new Error("This API has been removed. If you're looking for this " + "functionality in Babel 7, you should import the " + "'@babel/helper-module-imports' module and use the functions exposed " + " from that module, such as 'addNamed' or 'addDefault'."); + } + + availableHelper(name, versionRange) { + let minVersion; + + try { + minVersion = helpers().minVersion(name); + } catch (err) { + if (err.code !== "BABEL_HELPER_UNKNOWN") throw err; + return false; + } + + if (typeof versionRange !== "string") return true; + if (_semver().default.valid(versionRange)) versionRange = `^${versionRange}`; + return !_semver().default.intersects(`<${minVersion}`, versionRange) && !_semver().default.intersects(`>=8.0.0`, versionRange); + } + + addHelper(name) { + const declar = this.declarations[name]; + if (declar) return t().cloneNode(declar); + const generator = this.get("helperGenerator"); + + if (generator) { + const res = generator(name); + if (res) return res; + } + + helpers().ensure(name, File); + const uid = this.declarations[name] = this.scope.generateUidIdentifier(name); + const dependencies = {}; + + for (const dep of helpers().getDependencies(name)) { + dependencies[dep] = this.addHelper(dep); + } + + const { + nodes, + globals + } = helpers().get(name, dep => dependencies[dep], uid, Object.keys(this.scope.getAllBindings())); + globals.forEach(name => { + if (this.path.scope.hasBinding(name, true)) { + this.path.scope.rename(name); + } + }); + nodes.forEach(node => { + node._compact = true; + }); + this.path.unshiftContainer("body", nodes); + this.path.get("body").forEach(path => { + if (nodes.indexOf(path.node) === -1) return; + if (path.isVariableDeclaration()) this.scope.registerDeclaration(path); + }); + return uid; + } + + addTemplateObject() { + throw new Error("This function has been moved into the template literal transform itself."); + } + + buildCodeFrameError(node, msg, Error = SyntaxError) { + let loc = node && (node.loc || node._loc); + + if (!loc && node) { + const state = { + loc: null + }; + (0, _traverse().default)(node, errorVisitor, this.scope, state); + loc = state.loc; + let txt = "This is an error on an internal node. Probably an internal error."; + if (loc) txt += " Location has been estimated."; + msg += ` (${txt})`; + } + + if (loc) { + const { + highlightCode = true + } = this.opts; + msg += "\n" + (0, _codeFrame().codeFrameColumns)(this.code, { + start: { + line: loc.start.line, + column: loc.start.column + 1 + }, + end: loc.end && loc.start.line === loc.end.line ? { + line: loc.end.line, + column: loc.end.column + 1 + } : undefined + }, { + highlightCode + }); + } + + return new Error(msg); + } + +} + +exports.default = File; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transformation/file/generate.js b/tools/node_modules/@babel/core/lib/transformation/file/generate.js new file mode 100644 index 00000000000000..3301b56d247e9d --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transformation/file/generate.js @@ -0,0 +1,89 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = generateCode; + +function _convertSourceMap() { + const data = _interopRequireDefault(require("convert-source-map")); + + _convertSourceMap = function () { + return data; + }; + + return data; +} + +function _generator() { + const data = _interopRequireDefault(require("@babel/generator")); + + _generator = function () { + return data; + }; + + return data; +} + +var _mergeMap = _interopRequireDefault(require("./merge-map")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function generateCode(pluginPasses, file) { + const { + opts, + ast, + code, + inputMap + } = file; + const results = []; + + for (const plugins of pluginPasses) { + for (const plugin of plugins) { + const { + generatorOverride + } = plugin; + + if (generatorOverride) { + const result = generatorOverride(ast, opts.generatorOpts, code, _generator().default); + if (result !== undefined) results.push(result); + } + } + } + + let result; + + if (results.length === 0) { + result = (0, _generator().default)(ast, opts.generatorOpts, code); + } else if (results.length === 1) { + result = results[0]; + + if (typeof result.then === "function") { + throw new Error(`You appear to be using an async codegen plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`); + } + } else { + throw new Error("More than one plugin attempted to override codegen."); + } + + let { + code: outputCode, + map: outputMap + } = result; + + if (outputMap && inputMap) { + outputMap = (0, _mergeMap.default)(inputMap.toObject(), outputMap); + } + + if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") { + outputCode += "\n" + _convertSourceMap().default.fromObject(outputMap).toComment(); + } + + if (opts.sourceMaps === "inline") { + outputMap = null; + } + + return { + outputCode, + outputMap + }; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transformation/file/merge-map.js b/tools/node_modules/@babel/core/lib/transformation/file/merge-map.js new file mode 100644 index 00000000000000..d49c994a289444 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transformation/file/merge-map.js @@ -0,0 +1,247 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = mergeSourceMap; + +function _sourceMap() { + const data = _interopRequireDefault(require("source-map")); + + _sourceMap = function () { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function mergeSourceMap(inputMap, map) { + const input = buildMappingData(inputMap); + const output = buildMappingData(map); + const mergedGenerator = new (_sourceMap().default.SourceMapGenerator)(); + + for (const { + source + } of input.sources) { + if (typeof source.content === "string") { + mergedGenerator.setSourceContent(source.path, source.content); + } + } + + if (output.sources.length === 1) { + const defaultSource = output.sources[0]; + const insertedMappings = new Map(); + eachInputGeneratedRange(input, (generated, original, source) => { + eachOverlappingGeneratedOutputRange(defaultSource, generated, item => { + const key = makeMappingKey(item); + if (insertedMappings.has(key)) return; + insertedMappings.set(key, item); + mergedGenerator.addMapping({ + source: source.path, + original: { + line: original.line, + column: original.columnStart + }, + generated: { + line: item.line, + column: item.columnStart + }, + name: original.name + }); + }); + }); + + for (const item of insertedMappings.values()) { + if (item.columnEnd === Infinity) { + continue; + } + + const clearItem = { + line: item.line, + columnStart: item.columnEnd + }; + const key = makeMappingKey(clearItem); + + if (insertedMappings.has(key)) { + continue; + } + + mergedGenerator.addMapping({ + generated: { + line: clearItem.line, + column: clearItem.columnStart + } + }); + } + } + + const result = mergedGenerator.toJSON(); + + if (typeof input.sourceRoot === "string") { + result.sourceRoot = input.sourceRoot; + } + + return result; +} + +function makeMappingKey(item) { + return `${item.line}/${item.columnStart}`; +} + +function eachOverlappingGeneratedOutputRange(outputFile, inputGeneratedRange, callback) { + const overlappingOriginal = filterApplicableOriginalRanges(outputFile, inputGeneratedRange); + + for (const { + generated + } of overlappingOriginal) { + for (const item of generated) { + callback(item); + } + } +} + +function filterApplicableOriginalRanges({ + mappings +}, { + line, + columnStart, + columnEnd +}) { + return filterSortedArray(mappings, ({ + original: outOriginal + }) => { + if (line > outOriginal.line) return -1; + if (line < outOriginal.line) return 1; + if (columnStart >= outOriginal.columnEnd) return -1; + if (columnEnd <= outOriginal.columnStart) return 1; + return 0; + }); +} + +function eachInputGeneratedRange(map, callback) { + for (const { + source, + mappings + } of map.sources) { + for (const { + original, + generated + } of mappings) { + for (const item of generated) { + callback(item, original, source); + } + } + } +} + +function buildMappingData(map) { + const consumer = new (_sourceMap().default.SourceMapConsumer)(Object.assign({}, map, { + sourceRoot: null + })); + const sources = new Map(); + const mappings = new Map(); + let last = null; + consumer.computeColumnSpans(); + consumer.eachMapping(m => { + if (m.originalLine === null) return; + let source = sources.get(m.source); + + if (!source) { + source = { + path: m.source, + content: consumer.sourceContentFor(m.source, true) + }; + sources.set(m.source, source); + } + + let sourceData = mappings.get(source); + + if (!sourceData) { + sourceData = { + source, + mappings: [] + }; + mappings.set(source, sourceData); + } + + const obj = { + line: m.originalLine, + columnStart: m.originalColumn, + columnEnd: Infinity, + name: m.name + }; + + if (last && last.source === source && last.mapping.line === m.originalLine) { + last.mapping.columnEnd = m.originalColumn; + } + + last = { + source, + mapping: obj + }; + sourceData.mappings.push({ + original: obj, + generated: consumer.allGeneratedPositionsFor({ + source: m.source, + line: m.originalLine, + column: m.originalColumn + }).map(item => ({ + line: item.line, + columnStart: item.column, + columnEnd: item.lastColumn + 1 + })) + }); + }, null, _sourceMap().default.SourceMapConsumer.ORIGINAL_ORDER); + return { + file: map.file, + sourceRoot: map.sourceRoot, + sources: Array.from(mappings.values()) + }; +} + +function findInsertionLocation(array, callback) { + let left = 0; + let right = array.length; + + while (left < right) { + const mid = Math.floor((left + right) / 2); + const item = array[mid]; + const result = callback(item); + + if (result === 0) { + left = mid; + break; + } + + if (result >= 0) { + right = mid; + } else { + left = mid + 1; + } + } + + let i = left; + + if (i < array.length) { + while (i >= 0 && callback(array[i]) >= 0) { + i--; + } + + return i + 1; + } + + return i; +} + +function filterSortedArray(array, callback) { + const start = findInsertionLocation(array, callback); + const results = []; + + for (let i = start; i < array.length && callback(array[i]) === 0; i++) { + results.push(array[i]); + } + + return results; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transformation/index.js b/tools/node_modules/@babel/core/lib/transformation/index.js new file mode 100644 index 00000000000000..bb35bbe0f1c63f --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transformation/index.js @@ -0,0 +1,126 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = run; + +function _traverse() { + const data = _interopRequireDefault(require("@babel/traverse")); + + _traverse = function () { + return data; + }; + + return data; +} + +var _pluginPass = _interopRequireDefault(require("./plugin-pass")); + +var _blockHoistPlugin = _interopRequireDefault(require("./block-hoist-plugin")); + +var _normalizeOpts = _interopRequireDefault(require("./normalize-opts")); + +var _normalizeFile = _interopRequireDefault(require("./normalize-file")); + +var _generate = _interopRequireDefault(require("./file/generate")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function* run(config, code, ast) { + const file = yield* (0, _normalizeFile.default)(config.passes, (0, _normalizeOpts.default)(config), code, ast); + const opts = file.opts; + + try { + yield* transformFile(file, config.passes); + } catch (e) { + var _opts$filename; + + e.message = `${(_opts$filename = opts.filename) != null ? _opts$filename : "unknown"}: ${e.message}`; + + if (!e.code) { + e.code = "BABEL_TRANSFORM_ERROR"; + } + + throw e; + } + + let outputCode, outputMap; + + try { + if (opts.code !== false) { + ({ + outputCode, + outputMap + } = (0, _generate.default)(config.passes, file)); + } + } catch (e) { + var _opts$filename2; + + e.message = `${(_opts$filename2 = opts.filename) != null ? _opts$filename2 : "unknown"}: ${e.message}`; + + if (!e.code) { + e.code = "BABEL_GENERATE_ERROR"; + } + + throw e; + } + + return { + metadata: file.metadata, + options: opts, + ast: opts.ast === true ? file.ast : null, + code: outputCode === undefined ? null : outputCode, + map: outputMap === undefined ? null : outputMap, + sourceType: file.ast.program.sourceType + }; +} + +function* transformFile(file, pluginPasses) { + for (const pluginPairs of pluginPasses) { + const passPairs = []; + const passes = []; + const visitors = []; + + for (const plugin of pluginPairs.concat([(0, _blockHoistPlugin.default)()])) { + const pass = new _pluginPass.default(file, plugin.key, plugin.options); + passPairs.push([plugin, pass]); + passes.push(pass); + visitors.push(plugin.visitor); + } + + for (const [plugin, pass] of passPairs) { + const fn = plugin.pre; + + if (fn) { + const result = fn.call(pass, file); + yield* []; + + if (isThenable(result)) { + throw new Error(`You appear to be using an plugin with an async .pre, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`); + } + } + } + + const visitor = _traverse().default.visitors.merge(visitors, passes, file.opts.wrapPluginVisitorMethod); + + (0, _traverse().default)(file.ast, visitor, file.scope); + + for (const [plugin, pass] of passPairs) { + const fn = plugin.post; + + if (fn) { + const result = fn.call(pass, file); + yield* []; + + if (isThenable(result)) { + throw new Error(`You appear to be using an plugin with an async .post, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`); + } + } + } + } +} + +function isThenable(val) { + return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function"; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transformation/normalize-file.js b/tools/node_modules/@babel/core/lib/transformation/normalize-file.js new file mode 100644 index 00000000000000..b6006bca787e46 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transformation/normalize-file.js @@ -0,0 +1,179 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = normalizeFile; + +function _fs() { + const data = _interopRequireDefault(require("fs")); + + _fs = function () { + return data; + }; + + return data; +} + +function _path() { + const data = _interopRequireDefault(require("path")); + + _path = function () { + return data; + }; + + return data; +} + +function _debug() { + const data = _interopRequireDefault(require("debug")); + + _debug = function () { + return data; + }; + + return data; +} + +function _cloneDeep() { + const data = _interopRequireDefault(require("lodash/cloneDeep")); + + _cloneDeep = function () { + return data; + }; + + return data; +} + +function t() { + const data = _interopRequireWildcard(require("@babel/types")); + + t = function () { + return data; + }; + + return data; +} + +function _convertSourceMap() { + const data = _interopRequireDefault(require("convert-source-map")); + + _convertSourceMap = function () { + return data; + }; + + return data; +} + +var _file = _interopRequireDefault(require("./file/file")); + +var _parser = _interopRequireDefault(require("../parser")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const debug = (0, _debug().default)("babel:transform:file"); +const LARGE_INPUT_SOURCEMAP_THRESHOLD = 1000000; + +function* normalizeFile(pluginPasses, options, code, ast) { + code = `${code || ""}`; + + if (ast) { + if (ast.type === "Program") { + ast = t().file(ast, [], []); + } else if (ast.type !== "File") { + throw new Error("AST root must be a Program or File node"); + } + + const { + cloneInputAst + } = options; + + if (cloneInputAst) { + ast = (0, _cloneDeep().default)(ast); + } + } else { + ast = yield* (0, _parser.default)(pluginPasses, options, code); + } + + let inputMap = null; + + if (options.inputSourceMap !== false) { + if (typeof options.inputSourceMap === "object") { + inputMap = _convertSourceMap().default.fromObject(options.inputSourceMap); + } + + if (!inputMap) { + const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast); + + if (lastComment) { + try { + inputMap = _convertSourceMap().default.fromComment(lastComment); + } catch (err) { + debug("discarding unknown inline input sourcemap", err); + } + } + } + + if (!inputMap) { + const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast); + + if (typeof options.filename === "string" && lastComment) { + try { + const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment); + + const inputMapContent = _fs().default.readFileSync(_path().default.resolve(_path().default.dirname(options.filename), match[1])); + + if (inputMapContent.length > LARGE_INPUT_SOURCEMAP_THRESHOLD) { + debug("skip merging input map > 1 MB"); + } else { + inputMap = _convertSourceMap().default.fromJSON(inputMapContent); + } + } catch (err) { + debug("discarding unknown file input sourcemap", err); + } + } else if (lastComment) { + debug("discarding un-loadable file input sourcemap"); + } + } + } + + return new _file.default(options, { + code, + ast, + inputMap + }); +} + +const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/; +const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/; + +function extractCommentsFromList(regex, comments, lastComment) { + if (comments) { + comments = comments.filter(({ + value + }) => { + if (regex.test(value)) { + lastComment = value; + return false; + } + + return true; + }); + } + + return [comments, lastComment]; +} + +function extractComments(regex, ast) { + let lastComment = null; + t().traverseFast(ast, node => { + [node.leadingComments, lastComment] = extractCommentsFromList(regex, node.leadingComments, lastComment); + [node.innerComments, lastComment] = extractCommentsFromList(regex, node.innerComments, lastComment); + [node.trailingComments, lastComment] = extractCommentsFromList(regex, node.trailingComments, lastComment); + }); + return lastComment; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transformation/normalize-opts.js b/tools/node_modules/@babel/core/lib/transformation/normalize-opts.js new file mode 100644 index 00000000000000..1465ad698a5523 --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transformation/normalize-opts.js @@ -0,0 +1,65 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = normalizeOptions; + +function _path() { + const data = _interopRequireDefault(require("path")); + + _path = function () { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function normalizeOptions(config) { + const { + filename, + cwd, + filenameRelative = typeof filename === "string" ? _path().default.relative(cwd, filename) : "unknown", + sourceType = "module", + inputSourceMap, + sourceMaps = !!inputSourceMap, + moduleRoot, + sourceRoot = moduleRoot, + sourceFileName = _path().default.basename(filenameRelative), + comments = true, + compact = "auto" + } = config.options; + const opts = config.options; + const options = Object.assign({}, opts, { + parserOpts: Object.assign({ + sourceType: _path().default.extname(filenameRelative) === ".mjs" ? "module" : sourceType, + sourceFileName: filename, + plugins: [] + }, opts.parserOpts), + generatorOpts: Object.assign({ + filename, + auxiliaryCommentBefore: opts.auxiliaryCommentBefore, + auxiliaryCommentAfter: opts.auxiliaryCommentAfter, + retainLines: opts.retainLines, + comments, + shouldPrintComment: opts.shouldPrintComment, + compact, + minified: opts.minified, + sourceMaps, + sourceRoot, + sourceFileName + }, opts.generatorOpts) + }); + + for (const plugins of config.passes) { + for (const plugin of plugins) { + if (plugin.manipulateOptions) { + plugin.manipulateOptions(options, options.parserOpts); + } + } + } + + return options; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/lib/transformation/plugin-pass.js b/tools/node_modules/@babel/core/lib/transformation/plugin-pass.js new file mode 100644 index 00000000000000..ea2efdfefcfbdd --- /dev/null +++ b/tools/node_modules/@babel/core/lib/transformation/plugin-pass.js @@ -0,0 +1,53 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +class PluginPass { + constructor(file, key, options) { + this._map = new Map(); + this.key = void 0; + this.file = void 0; + this.opts = void 0; + this.cwd = void 0; + this.filename = void 0; + this.key = key; + this.file = file; + this.opts = options || {}; + this.cwd = file.opts.cwd; + this.filename = file.opts.filename; + } + + set(key, val) { + this._map.set(key, val); + } + + get(key) { + return this._map.get(key); + } + + availableHelper(name, versionRange) { + return this.file.availableHelper(name, versionRange); + } + + addHelper(name) { + return this.file.addHelper(name); + } + + addImport() { + return this.file.addImport(); + } + + getModuleName() { + return this.file.getModuleName(); + } + + buildCodeFrameError(node, msg, Error) { + return this.file.buildCodeFrameError(node, msg, Error); + } + +} + +exports.default = PluginPass; \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/code-frame/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/LICENSE rename to tools/node_modules/@babel/core/node_modules/@babel/code-frame/LICENSE diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/README.md b/tools/node_modules/@babel/core/node_modules/@babel/code-frame/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/code-frame/README.md rename to tools/node_modules/@babel/core/node_modules/@babel/code-frame/README.md diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/code-frame/lib/index.js similarity index 80% rename from tools/node_modules/babel-eslint/node_modules/@babel/code-frame/lib/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/code-frame/lib/index.js index 35176fbc0682ca..28d86f7bc1cc8a 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/lib/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/code-frame/lib/index.js @@ -6,17 +6,11 @@ Object.defineProperty(exports, "__esModule", { exports.codeFrameColumns = codeFrameColumns; exports.default = _default; -function _highlight() { - const data = _interopRequireWildcard(require("@babel/highlight")); +var _highlight = _interopRequireWildcard(require("@babel/highlight")); - _highlight = function () { - return data; - }; - - return data; -} +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } let deprecationWarningShown = false; @@ -94,8 +88,8 @@ function getMarkerLines(loc, source, opts) { } function codeFrameColumns(rawLines, loc, opts = {}) { - const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight().shouldHighlight)(opts); - const chalk = (0, _highlight().getChalk)(opts); + const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); + const chalk = (0, _highlight.getChalk)(opts); const defs = getDefs(chalk); const maybeHighlight = (chalkFn, string) => { @@ -110,7 +104,7 @@ function codeFrameColumns(rawLines, loc, opts = {}) { } = getMarkerLines(loc, lines, opts); const hasColumns = loc.start && typeof loc.start.column === "number"; const numberMaxWidth = String(end).length; - const highlightedLines = highlighted ? (0, _highlight().default)(rawLines, opts) : rawLines; + const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines; let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => { const number = start + 1 + index; const paddedNumber = ` ${number}`.slice(-numberMaxWidth); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/package.json b/tools/node_modules/@babel/core/node_modules/@babel/code-frame/package.json similarity index 54% rename from tools/node_modules/babel-eslint/node_modules/@babel/code-frame/package.json rename to tools/node_modules/@babel/core/node_modules/@babel/code-frame/package.json index d619d9a8f53194..d2e0ccffde9971 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/code-frame/package.json +++ b/tools/node_modules/@babel/core/node_modules/@babel/code-frame/package.json @@ -1,29 +1,25 @@ { - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bundleDependencies": false, - "dependencies": { - "@babel/highlight": "^7.0.0" - }, - "deprecated": false, + "name": "@babel/code-frame", + "version": "7.10.4", "description": "Generate errors that contain a code frame that point to source locations.", - "devDependencies": { - "chalk": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43", + "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/code-frame", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/babel-code-frame" + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-code-frame" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/highlight": "^7.10.4" + }, + "devDependencies": { + "chalk": "^2.0.0", + "strip-ansi": "^4.0.0" }, - "version": "7.5.5" -} \ No newline at end of file + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df" +} diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-split-export-declaration/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/generator/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/helper-split-export-declaration/LICENSE rename to tools/node_modules/@babel/core/node_modules/@babel/generator/LICENSE diff --git a/tools/node_modules/@babel/core/node_modules/@babel/generator/README.md b/tools/node_modules/@babel/core/node_modules/@babel/generator/README.md new file mode 100644 index 00000000000000..b760238ebc5e89 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/README.md @@ -0,0 +1,19 @@ +# @babel/generator + +> Turns an AST into code. + +See our website [@babel/generator](https://babeljs.io/docs/en/babel-generator) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/generator +``` + +or using yarn: + +```sh +yarn add @babel/generator --dev +``` diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/buffer.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/buffer.js similarity index 83% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/buffer.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/buffer.js index 8a800148c201a5..333e08c9e69e18 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/buffer.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/buffer.js @@ -4,19 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - -function _trimRight() { - const data = _interopRequireDefault(require("trim-right")); - - _trimRight = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - const SPACES_RE = /^[ \t]+$/; class Buffer { @@ -44,9 +31,9 @@ class Buffer { const map = this._map; const result = { - code: (0, _trimRight().default)(this._buf.join("")), + code: this._buf.join("").trimRight(), map: null, - rawMappings: map && map.getRawMappings() + rawMappings: map == null ? void 0 : map.getRawMappings() }; if (map) { @@ -110,22 +97,35 @@ class Buffer { } _append(str, line, column, identifierName, filename, force) { - if (this._map && str[0] !== "\n") { - this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force); - } - this._buf.push(str); this._last = str[str.length - 1]; + let i = str.indexOf("\n"); + let last = 0; - for (let i = 0; i < str.length; i++) { - if (str[i] === "\n") { - this._position.line++; - this._position.column = 0; - } else { - this._position.column++; + if (i !== 0) { + this._mark(line, column, identifierName, filename, force); + } + + while (i !== -1) { + this._position.line++; + this._position.column = 0; + last = i + 1; + + if (last < str.length) { + this._mark(++line, 0, identifierName, filename, force); } + + i = str.indexOf("\n", last); } + + this._position.column += str.length - last; + } + + _mark(line, column, identifierName, filename, force) { + var _this$_map; + + (_this$_map = this._map) == null ? void 0 : _this$_map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force); } removeTrailingNewline() { @@ -221,10 +221,10 @@ class Buffer { const origLine = targetObj.line; const origColumn = targetObj.column; const origFilename = targetObj.filename; - targetObj.identifierName = prop === "start" && loc && loc.identifierName || null; - targetObj.line = pos ? pos.line : null; - targetObj.column = pos ? pos.column : null; - targetObj.filename = loc && loc.filename || null; + targetObj.identifierName = prop === "start" && (loc == null ? void 0 : loc.identifierName) || null; + targetObj.line = pos == null ? void 0 : pos.line; + targetObj.column = pos == null ? void 0 : pos.column; + targetObj.filename = loc == null ? void 0 : loc.filename; if (force || targetObj.line !== origLine || targetObj.column !== origColumn || targetObj.filename !== origFilename) { targetObj.force = force; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/base.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/base.js similarity index 94% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/base.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/base.js index f8e2130bf21e70..713827a9c8129b 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/base.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/base.js @@ -28,9 +28,11 @@ function Program(node) { } function BlockStatement(node) { + var _node$directives; + this.token("{"); this.printInnerComments(node); - const hasDirectives = node.directives && node.directives.length; + const hasDirectives = (_node$directives = node.directives) == null ? void 0 : _node$directives.length; if (node.body.length || hasDirectives) { this.newline(); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/classes.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/classes.js similarity index 64% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/classes.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/classes.js index 7f54632ad012e1..aa1e622da9cdcf 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/classes.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/classes.js @@ -10,21 +10,16 @@ exports.ClassPrivateProperty = ClassPrivateProperty; exports.ClassMethod = ClassMethod; exports.ClassPrivateMethod = ClassPrivateMethod; exports._classMethodHead = _classMethodHead; +exports.StaticBlock = StaticBlock; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function ClassDeclaration(node, parent) { - if (!this.format.decoratorsBeforeExport || !t().isExportDefaultDeclaration(parent) && !t().isExportNamedDeclaration(parent)) { + if (!this.format.decoratorsBeforeExport || !t.isExportDefaultDeclaration(parent) && !t.isExportNamedDeclaration(parent)) { this.printJoin(node.decorators, node); } @@ -84,26 +79,7 @@ function ClassBody(node) { function ClassProperty(node) { this.printJoin(node.decorators, node); - - if (node.accessibility) { - this.word(node.accessibility); - this.space(); - } - - if (node.static) { - this.word("static"); - this.space(); - } - - if (node.abstract) { - this.word("abstract"); - this.space(); - } - - if (node.readonly) { - this.word("readonly"); - this.space(); - } + this.tsPrintClassMemberModifiers(node, true); if (node.computed) { this.token("["); @@ -136,6 +112,8 @@ function ClassProperty(node) { } function ClassPrivateProperty(node) { + this.printJoin(node.decorators, node); + if (node.static) { this.word("static"); this.space(); @@ -170,21 +148,23 @@ function ClassPrivateMethod(node) { function _classMethodHead(node) { this.printJoin(node.decorators, node); + this.tsPrintClassMemberModifiers(node, false); - if (node.accessibility) { - this.word(node.accessibility); - this.space(); - } + this._methodHead(node); +} - if (node.abstract) { - this.word("abstract"); - this.space(); - } +function StaticBlock(node) { + this.word("static"); + this.space(); + this.token("{"); - if (node.static) { - this.word("static"); - this.space(); + if (node.body.length === 0) { + this.token("}"); + } else { + this.newline(); + this.printSequence(node.body, node, { + indent: true + }); + this.rightBrace(); } - - this._methodHead(node); } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/expressions.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/expressions.js similarity index 80% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/expressions.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/expressions.js index 45efa98efa1632..4e63a699408401 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/expressions.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/expressions.js @@ -25,21 +25,16 @@ exports.BindExpression = BindExpression; exports.MemberExpression = MemberExpression; exports.MetaProperty = MetaProperty; exports.PrivateName = PrivateName; +exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier; exports.AwaitExpression = exports.YieldExpression = void 0; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} +var t = _interopRequireWildcard(require("@babel/types")); var n = _interopRequireWildcard(require("../node")); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function UnaryExpression(node) { if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof" || node.operator === "throw") { @@ -93,9 +88,9 @@ function NewExpression(node, parent) { this.space(); this.print(node.callee, node); - if (this.format.minified && node.arguments.length === 0 && !node.optional && !t().isCallExpression(parent, { + if (this.format.minified && node.arguments.length === 0 && !node.optional && !t.isCallExpression(parent, { callee: node - }) && !t().isMemberExpression(parent) && !t().isNewExpression(parent)) { + }) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) { return; } @@ -132,13 +127,13 @@ function Decorator(node) { function OptionalMemberExpression(node) { this.print(node.object, node); - if (!node.computed && t().isMemberExpression(node.property)) { + if (!node.computed && t.isMemberExpression(node.property)) { throw new TypeError("Got a MemberExpression for MemberExpression property"); } let computed = node.computed; - if (t().isLiteral(node.property) && typeof node.property.value === "number") { + if (t.isLiteral(node.property) && typeof node.property.value === "number") { computed = true; } @@ -260,13 +255,13 @@ function BindExpression(node) { function MemberExpression(node) { this.print(node.object, node); - if (!node.computed && t().isMemberExpression(node.property)) { + if (!node.computed && t.isMemberExpression(node.property)) { throw new TypeError("Got a MemberExpression for MemberExpression property"); } let computed = node.computed; - if (t().isLiteral(node.property) && typeof node.property.value === "number") { + if (t.isLiteral(node.property) && typeof node.property.value === "number") { computed = true; } @@ -289,4 +284,9 @@ function MetaProperty(node) { function PrivateName(node) { this.token("#"); this.print(node.id, node); +} + +function V8IntrinsicIdentifier(node) { + this.token("%"); + this.word(node.name); } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/flow.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/flow.js similarity index 78% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/flow.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/flow.js index 8853fd8aabcefa..08c1734bee15da 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/flow.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/flow.js @@ -20,6 +20,15 @@ exports.DeclareOpaqueType = DeclareOpaqueType; exports.DeclareVariable = DeclareVariable; exports.DeclareExportDeclaration = DeclareExportDeclaration; exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration; +exports.EnumDeclaration = EnumDeclaration; +exports.EnumBooleanBody = EnumBooleanBody; +exports.EnumNumberBody = EnumNumberBody; +exports.EnumStringBody = EnumStringBody; +exports.EnumSymbolBody = EnumSymbolBody; +exports.EnumDefaultedMember = EnumDefaultedMember; +exports.EnumBooleanMember = EnumBooleanMember; +exports.EnumNumberMember = EnumNumberMember; +exports.EnumStringMember = EnumStringMember; exports.ExistsTypeAnnotation = ExistsTypeAnnotation; exports.FunctionTypeAnnotation = FunctionTypeAnnotation; exports.FunctionTypeParam = FunctionTypeParam; @@ -49,6 +58,7 @@ exports.ObjectTypeIndexer = ObjectTypeIndexer; exports.ObjectTypeProperty = ObjectTypeProperty; exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty; exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier; +exports.SymbolTypeAnnotation = SymbolTypeAnnotation; exports.UnionTypeAnnotation = UnionTypeAnnotation; exports.TypeCastExpression = TypeCastExpression; exports.Variance = Variance; @@ -66,21 +76,15 @@ Object.defineProperty(exports, "StringLiteralTypeAnnotation", { } }); -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} +var t = _interopRequireWildcard(require("@babel/types")); var _modules = require("./modules"); var _types2 = require("./types"); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function AnyTypeAnnotation() { this.word("any"); @@ -105,7 +109,7 @@ function NullLiteralTypeAnnotation() { } function DeclareClass(node, parent) { - if (!t().isDeclareExportDeclaration(parent)) { + if (!t.isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } @@ -117,7 +121,7 @@ function DeclareClass(node, parent) { } function DeclareFunction(node, parent) { - if (!t().isDeclareExportDeclaration(parent)) { + if (!t.isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } @@ -180,7 +184,7 @@ function DeclareTypeAlias(node) { } function DeclareOpaqueType(node, parent) { - if (!t().isDeclareExportDeclaration(parent)) { + if (!t.isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } @@ -189,7 +193,7 @@ function DeclareOpaqueType(node, parent) { } function DeclareVariable(node, parent) { - if (!t().isDeclareExportDeclaration(parent)) { + if (!t.isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } @@ -222,11 +226,112 @@ function DeclareExportAllDeclaration() { _modules.ExportAllDeclaration.apply(this, arguments); } +function EnumDeclaration(node) { + const { + id, + body + } = node; + this.word("enum"); + this.space(); + this.print(id, node); + this.print(body, node); +} + +function enumExplicitType(context, name, hasExplicitType) { + if (hasExplicitType) { + context.space(); + context.word("of"); + context.space(); + context.word(name); + } + + context.space(); +} + +function enumBody(context, node) { + const { + members + } = node; + context.token("{"); + context.indent(); + context.newline(); + + for (const member of members) { + context.print(member, node); + context.newline(); + } + + context.dedent(); + context.token("}"); +} + +function EnumBooleanBody(node) { + const { + explicitType + } = node; + enumExplicitType(this, "boolean", explicitType); + enumBody(this, node); +} + +function EnumNumberBody(node) { + const { + explicitType + } = node; + enumExplicitType(this, "number", explicitType); + enumBody(this, node); +} + +function EnumStringBody(node) { + const { + explicitType + } = node; + enumExplicitType(this, "string", explicitType); + enumBody(this, node); +} + +function EnumSymbolBody(node) { + enumExplicitType(this, "symbol", true); + enumBody(this, node); +} + +function EnumDefaultedMember(node) { + const { + id + } = node; + this.print(id, node); + this.token(","); +} + +function enumInitializedMember(context, node) { + const { + id, + init + } = node; + context.print(id, node); + context.space(); + context.token("="); + context.space(); + context.print(init, node); + context.token(","); +} + +function EnumBooleanMember(node) { + enumInitializedMember(this, node); +} + +function EnumNumberMember(node) { + enumInitializedMember(this, node); +} + +function EnumStringMember(node) { + enumInitializedMember(this, node); +} + function FlowExportDeclaration(node) { if (node.declaration) { const declar = node.declaration; this.print(declar, node); - if (!t().isStatement(declar)) this.semicolon(); + if (!t.isStatement(declar)) this.semicolon(); } else { this.token("{"); @@ -583,6 +688,11 @@ function ObjectTypeProperty(node) { this.space(); } + if (node.kind === "get" || node.kind === "set") { + this.word(node.kind); + this.space(); + } + this._variance(node); this.print(node.key, node); @@ -607,6 +717,10 @@ function QualifiedTypeIdentifier(node) { this.print(node.id, node); } +function SymbolTypeAnnotation() { + this.word("symbol"); +} + function orSeparator() { this.space(); this.token("|"); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/index.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/index.js similarity index 81% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/index.js index f2b4cecad56953..8820db09efe93c 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/index.js @@ -8,6 +8,7 @@ var _templateLiterals = require("./template-literals"); Object.keys(_templateLiterals).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _templateLiterals[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -20,6 +21,7 @@ var _expressions = require("./expressions"); Object.keys(_expressions).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _expressions[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -32,6 +34,7 @@ var _statements = require("./statements"); Object.keys(_statements).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _statements[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -44,6 +47,7 @@ var _classes = require("./classes"); Object.keys(_classes).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _classes[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -56,6 +60,7 @@ var _methods = require("./methods"); Object.keys(_methods).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _methods[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -68,6 +73,7 @@ var _modules = require("./modules"); Object.keys(_modules).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _modules[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -80,6 +86,7 @@ var _types = require("./types"); Object.keys(_types).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _types[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -92,6 +99,7 @@ var _flow = require("./flow"); Object.keys(_flow).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _flow[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -104,6 +112,7 @@ var _base = require("./base"); Object.keys(_base).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _base[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -116,6 +125,7 @@ var _jsx = require("./jsx"); Object.keys(_jsx).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _jsx[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -128,6 +138,7 @@ var _typescript = require("./typescript"); Object.keys(_typescript).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _typescript[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/jsx.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/jsx.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/jsx.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/jsx.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/methods.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/methods.js similarity index 71% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/methods.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/methods.js index 39965bacc19f46..f51ab2e79b3f88 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/methods.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/methods.js @@ -12,17 +12,11 @@ exports._functionHead = _functionHead; exports.FunctionDeclaration = exports.FunctionExpression = FunctionExpression; exports.ArrowFunctionExpression = ArrowFunctionExpression; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _params(node) { this.print(node.typeParameters, node); @@ -62,6 +56,8 @@ function _methodHead(node) { } if (node.async) { + this._catchUp("start", key.loc); + this.word("async"); this.space(); } @@ -132,8 +128,8 @@ function ArrowFunctionExpression(node) { const firstParam = node.params[0]; - if (node.params.length === 1 && t().isIdentifier(firstParam) && !hasTypes(node, firstParam)) { - if (this.format.retainLines && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) { + if (node.params.length === 1 && t.isIdentifier(firstParam) && !hasTypes(node, firstParam)) { + if ((this.format.retainLines || node.async) && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) { this.token("("); if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/modules.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/modules.js similarity index 68% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/modules.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/modules.js index af87bd586e68f0..ad26632973036a 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/modules.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/modules.js @@ -12,19 +12,14 @@ exports.ExportAllDeclaration = ExportAllDeclaration; exports.ExportNamedDeclaration = ExportNamedDeclaration; exports.ExportDefaultDeclaration = ExportDefaultDeclaration; exports.ImportDeclaration = ImportDeclaration; +exports.ImportAttribute = ImportAttribute; exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function ImportSpecifier(node) { if (node.importKind === "type" || node.importKind === "typeof") { @@ -83,11 +78,12 @@ function ExportAllDeclaration(node) { this.word("from"); this.space(); this.print(node.source, node); + this.printAssertions(node); this.semicolon(); } function ExportNamedDeclaration(node) { - if (this.format.decoratorsBeforeExport && t().isClassDeclaration(node.declaration)) { + if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) { this.printJoin(node.declaration.decorators, node); } @@ -97,7 +93,7 @@ function ExportNamedDeclaration(node) { } function ExportDefaultDeclaration(node) { - if (this.format.decoratorsBeforeExport && t().isClassDeclaration(node.declaration)) { + if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) { this.printJoin(node.declaration.decorators, node); } @@ -112,7 +108,7 @@ function ExportDeclaration(node) { if (node.declaration) { const declar = node.declaration; this.print(declar, node); - if (!t().isStatement(declar)) this.semicolon(); + if (!t.isStatement(declar)) this.semicolon(); } else { if (node.exportKind === "type") { this.word("type"); @@ -122,10 +118,10 @@ function ExportDeclaration(node) { const specifiers = node.specifiers.slice(0); let hasSpecial = false; - while (true) { + for (;;) { const first = specifiers[0]; - if (t().isExportDefaultSpecifier(first) || t().isExportNamespaceSpecifier(first)) { + if (t.isExportDefaultSpecifier(first) || t.isExportNamespaceSpecifier(first)) { hasSpecial = true; this.print(specifiers.shift(), node); @@ -155,6 +151,7 @@ function ExportDeclaration(node) { this.word("from"); this.space(); this.print(node.source, node); + this.printAssertions(node); } this.semicolon(); @@ -162,6 +159,8 @@ function ExportDeclaration(node) { } function ImportDeclaration(node) { + var _node$attributes; + this.word("import"); this.space(); @@ -172,11 +171,11 @@ function ImportDeclaration(node) { const specifiers = node.specifiers.slice(0); - if (specifiers && specifiers.length) { - while (true) { + if (specifiers == null ? void 0 : specifiers.length) { + for (;;) { const first = specifiers[0]; - if (t().isImportDefaultSpecifier(first) || t().isImportNamespaceSpecifier(first)) { + if (t.isImportDefaultSpecifier(first) || t.isImportNamespaceSpecifier(first)) { this.print(specifiers.shift(), node); if (specifiers.length) { @@ -202,9 +201,25 @@ function ImportDeclaration(node) { } this.print(node.source, node); + this.printAssertions(node); + + if ((_node$attributes = node.attributes) == null ? void 0 : _node$attributes.length) { + this.space(); + this.word("with"); + this.space(); + this.printList(node.attributes, node); + } + this.semicolon(); } +function ImportAttribute(node) { + this.print(node.key); + this.token(":"); + this.space(); + this.print(node.value); +} + function ImportNamespaceSpecifier(node) { this.token("*"); this.space(); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/statements.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/statements.js similarity index 84% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/statements.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/statements.js index c74363de594459..3a9dbfa8358640 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/statements.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/statements.js @@ -18,17 +18,11 @@ exports.VariableDeclaration = VariableDeclaration; exports.VariableDeclarator = VariableDeclarator; exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForOfStatement = exports.ForInStatement = void 0; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; - - return data; -} +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function WithStatement(node) { this.word("with"); @@ -46,7 +40,7 @@ function IfStatement(node) { this.print(node.test, node); this.token(")"); this.space(); - const needsBlock = node.alternate && t().isIfStatement(getLastStatement(node.consequent)); + const needsBlock = node.alternate && t.isIfStatement(getLastStatement(node.consequent)); if (needsBlock) { this.token("{"); @@ -71,7 +65,7 @@ function IfStatement(node) { } function getLastStatement(statement) { - if (!t().isStatement(statement.body)) return statement; + if (!t.isStatement(statement.body)) return statement; return getLastStatement(statement.body); } @@ -208,6 +202,7 @@ function CatchClause(node) { if (node.param) { this.token("("); this.print(node.param, node); + this.print(node.param.typeAnnotation, node); this.token(")"); this.space(); } @@ -280,7 +275,7 @@ function VariableDeclaration(node, parent) { this.space(); let hasInits = false; - if (!t().isFor(parent)) { + if (!t.isFor(parent)) { for (const declar of node.declarations) { if (declar.init) { hasInits = true; @@ -298,7 +293,7 @@ function VariableDeclaration(node, parent) { separator }); - if (t().isFor(parent)) { + if (t.isFor(parent)) { if (parent.left === node || parent.init === node) return; } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/template-literals.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/template-literals.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/template-literals.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/template-literals.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/types.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/types.js similarity index 52% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/types.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/types.js index 12ae494fb7f18a..603a5935b5061c 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/types.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/types.js @@ -10,39 +10,28 @@ exports.ObjectPattern = exports.ObjectExpression = ObjectExpression; exports.ObjectMethod = ObjectMethod; exports.ObjectProperty = ObjectProperty; exports.ArrayPattern = exports.ArrayExpression = ArrayExpression; +exports.RecordExpression = RecordExpression; +exports.TupleExpression = TupleExpression; exports.RegExpLiteral = RegExpLiteral; exports.BooleanLiteral = BooleanLiteral; exports.NullLiteral = NullLiteral; exports.NumericLiteral = NumericLiteral; exports.StringLiteral = StringLiteral; exports.BigIntLiteral = BigIntLiteral; +exports.DecimalLiteral = DecimalLiteral; exports.PipelineTopicExpression = PipelineTopicExpression; exports.PipelineBareFunction = PipelineBareFunction; exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; - - return data; -} - -function _jsesc() { - const data = _interopRequireDefault(require("jsesc")); - - _jsesc = function () { - return data; - }; - - return data; -} +var _jsesc = _interopRequireDefault(require("jsesc")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function Identifier(node) { this.exactSource(node.loc, () => { @@ -93,14 +82,14 @@ function ObjectProperty(node) { this.print(node.key, node); this.token("]"); } else { - if (t().isAssignmentPattern(node.value) && t().isIdentifier(node.key) && node.key.name === node.value.left.name) { + if (t.isAssignmentPattern(node.value) && t.isIdentifier(node.key) && node.key.name === node.value.left.name) { this.print(node.value, node); return; } this.print(node.key, node); - if (node.shorthand && t().isIdentifier(node.key) && t().isIdentifier(node.value) && node.key.name === node.value.name) { + if (node.shorthand && t.isIdentifier(node.key) && t.isIdentifier(node.value) && node.key.name === node.value.name) { return; } } @@ -131,6 +120,68 @@ function ArrayExpression(node) { this.token("]"); } +function RecordExpression(node) { + const props = node.properties; + let startToken; + let endToken; + + if (this.format.recordAndTupleSyntaxType === "bar") { + startToken = "{|"; + endToken = "|}"; + } else if (this.format.recordAndTupleSyntaxType === "hash") { + startToken = "#{"; + endToken = "}"; + } else { + throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`); + } + + this.token(startToken); + this.printInnerComments(node); + + if (props.length) { + this.space(); + this.printList(props, node, { + indent: true, + statement: true + }); + this.space(); + } + + this.token(endToken); +} + +function TupleExpression(node) { + const elems = node.elements; + const len = elems.length; + let startToken; + let endToken; + + if (this.format.recordAndTupleSyntaxType === "bar") { + startToken = "[|"; + endToken = "|]"; + } else if (this.format.recordAndTupleSyntaxType === "hash") { + startToken = "#["; + endToken = "]"; + } else { + throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`); + } + + this.token(startToken); + this.printInnerComments(node); + + for (let i = 0; i < elems.length; i++) { + const elem = elems[i]; + + if (elem) { + if (i > 0) this.space(); + this.print(elem, node); + if (i < len - 1) this.token(","); + } + } + + this.token(endToken); +} + function RegExpLiteral(node) { this.word(`/${node.pattern}/${node.flags}`); } @@ -145,9 +196,12 @@ function NullLiteral() { function NumericLiteral(node) { const raw = this.getPossibleRaw(node); + const opts = this.format.jsescOption; const value = node.value + ""; - if (raw == null) { + if (opts.numbers) { + this.number((0, _jsesc.default)(node.value, opts)); + } else if (raw == null) { this.number(value); } else if (this.format.minified) { this.number(raw.length < value.length ? raw : value); @@ -170,7 +224,7 @@ function StringLiteral(node) { opts.json = true; } - const val = (0, _jsesc().default)(node.value, opts); + const val = (0, _jsesc.default)(node.value, opts); return this.token(val); } @@ -182,7 +236,18 @@ function BigIntLiteral(node) { return; } - this.token(node.value); + this.token(node.value + "n"); +} + +function DecimalLiteral(node) { + const raw = this.getPossibleRaw(node); + + if (!this.format.minified && raw != null) { + this.token(raw); + return; + } + + this.token(node.value + "m"); } function PipelineTopicExpression(node) { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/typescript.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/typescript.js similarity index 91% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/typescript.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/typescript.js index 0355057de93865..4e938e6fa2ab05 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/generators/typescript.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/generators/typescript.js @@ -17,6 +17,7 @@ exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName; exports.TSMethodSignature = TSMethodSignature; exports.TSIndexSignature = TSIndexSignature; exports.TSAnyKeyword = TSAnyKeyword; +exports.TSBigIntKeyword = TSBigIntKeyword; exports.TSUnknownKeyword = TSUnknownKeyword; exports.TSNumberKeyword = TSNumberKeyword; exports.TSObjectKeyword = TSObjectKeyword; @@ -27,6 +28,7 @@ exports.TSVoidKeyword = TSVoidKeyword; exports.TSUndefinedKeyword = TSUndefinedKeyword; exports.TSNullKeyword = TSNullKeyword; exports.TSNeverKeyword = TSNeverKeyword; +exports.TSIntrinsicKeyword = TSIntrinsicKeyword; exports.TSThisType = TSThisType; exports.TSFunctionType = TSFunctionType; exports.TSConstructorType = TSConstructorType; @@ -41,6 +43,7 @@ exports.TSArrayType = TSArrayType; exports.TSTupleType = TSTupleType; exports.TSOptionalType = TSOptionalType; exports.TSRestType = TSRestType; +exports.TSNamedTupleMember = TSNamedTupleMember; exports.TSUnionType = TSUnionType; exports.TSIntersectionType = TSIntersectionType; exports.tsPrintUnionOrIntersectionType = tsPrintUnionOrIntersectionType; @@ -68,6 +71,7 @@ exports.TSNonNullExpression = TSNonNullExpression; exports.TSExportAssignment = TSExportAssignment; exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration; exports.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase; +exports.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers; function TSTypeAnnotation(node) { this.token(":"); @@ -139,12 +143,14 @@ function TSQualifiedName(node) { function TSCallSignatureDeclaration(node) { this.tsPrintSignatureDeclarationBase(node); + this.token(";"); } function TSConstructSignatureDeclaration(node) { this.word("new"); this.space(); this.tsPrintSignatureDeclarationBase(node); + this.token(";"); } function TSPropertySignature(node) { @@ -216,6 +222,10 @@ function TSAnyKeyword() { this.word("any"); } +function TSBigIntKeyword() { + this.word("bigint"); +} + function TSUnknownKeyword() { this.word("unknown"); } @@ -256,6 +266,10 @@ function TSNeverKeyword() { this.word("never"); } +function TSIntrinsicKeyword() { + this.word("intrinsic"); +} + function TSThisType() { this.word("this"); } @@ -293,11 +307,19 @@ function TSTypeReference(node) { } function TSTypePredicate(node) { + if (node.asserts) { + this.word("asserts"); + this.space(); + } + this.print(node.parameterName); - this.space(); - this.word("is"); - this.space(); - this.print(node.typeAnnotation.typeAnnotation); + + if (node.typeAnnotation) { + this.space(); + this.word("is"); + this.space(); + this.print(node.typeAnnotation.typeAnnotation); + } } function TSTypeQuery(node) { @@ -354,6 +376,14 @@ function TSRestType(node) { this.print(node.typeAnnotation, node); } +function TSNamedTupleMember(node) { + this.print(node.label, node); + if (node.optional) this.token("?"); + this.token(":"); + this.space(); + this.print(node.elementType, node); +} + function TSUnionType(node) { this.tsPrintUnionOrIntersectionType(node, "|"); } @@ -402,7 +432,7 @@ function TSParenthesizedType(node) { } function TSTypeOperator(node) { - this.token(node.operator); + this.word(node.operator); this.space(); this.print(node.typeAnnotation, node); } @@ -416,9 +446,10 @@ function TSIndexedAccessType(node) { function TSMappedType(node) { const { + nameType, + optional, readonly, - typeParameter, - optional + typeParameter } = node; this.token("{"); this.space(); @@ -435,6 +466,14 @@ function TSMappedType(node) { this.word("in"); this.space(); this.print(typeParameter.constraint, typeParameter); + + if (nameType) { + this.space(); + this.word("as"); + this.space(); + this.print(nameType, node); + } + this.token("]"); if (optional) { @@ -712,4 +751,31 @@ function tsPrintSignatureDeclarationBase(node) { this.token(")"); this.print(node.typeAnnotation, node); +} + +function tsPrintClassMemberModifiers(node, isField) { + if (isField && node.declare) { + this.word("declare"); + this.space(); + } + + if (node.accessibility) { + this.word(node.accessibility); + this.space(); + } + + if (node.static) { + this.word("static"); + this.space(); + } + + if (node.abstract) { + this.word("abstract"); + this.space(); + } + + if (isField && node.readonly) { + this.word("readonly"); + this.space(); + } } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/index.js similarity index 95% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/index.js index fcdb288b7f2fc9..115ab16a10a898 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/index.js @@ -17,6 +17,7 @@ class Generator extends _printer.default { const format = normalizeOptions(code, opts); const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null; super(format, map); + this.ast = void 0; this.ast = ast; } @@ -47,7 +48,8 @@ function normalizeOptions(code, opts) { jsescOption: Object.assign({ quotes: "double", wrap: true - }, opts.jsescOption) + }, opts.jsescOption), + recordAndTupleSyntaxType: opts.recordAndTupleSyntaxType }; if (format.minified) { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/node/index.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/node/index.js similarity index 65% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/node/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/node/index.js index bef46f0eede721..1cbc55ecc3fa61 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/node/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/node/index.js @@ -12,17 +12,11 @@ var whitespace = _interopRequireWildcard(require("./whitespace")); var parens = _interopRequireWildcard(require("./parentheses")); -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function expandAliases(obj) { const newObj = {}; @@ -36,7 +30,7 @@ function expandAliases(obj) { } for (const type of Object.keys(obj)) { - const aliases = t().FLIPPED_ALIAS_KEYS[type]; + const aliases = t.FLIPPED_ALIAS_KEYS[type]; if (aliases) { for (const alias of aliases) { @@ -60,21 +54,17 @@ function find(obj, node, parent, printStack) { } function isOrHasCallExpression(node) { - if (t().isCallExpression(node)) { + if (t.isCallExpression(node)) { return true; } - if (t().isMemberExpression(node)) { - return isOrHasCallExpression(node.object) || !node.computed && isOrHasCallExpression(node.property); - } else { - return false; - } + return t.isMemberExpression(node) && isOrHasCallExpression(node.object); } function needsWhitespace(node, parent, type) { if (!node) return 0; - if (t().isExpressionStatement(node)) { + if (t.isExpressionStatement(node)) { node = node.expression; } @@ -109,7 +99,7 @@ function needsWhitespaceAfter(node, parent) { function needsParens(node, parent, printStack) { if (!parent) return false; - if (t().isNewExpression(parent) && parent.callee === node) { + if (t.isNewExpression(parent) && parent.callee === node) { if (isOrHasCallExpression(node)) return true; } diff --git a/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/node/parentheses.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/node/parentheses.js new file mode 100644 index 00000000000000..9f848db204f0e5 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/node/parentheses.js @@ -0,0 +1,253 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NullableTypeAnnotation = NullableTypeAnnotation; +exports.FunctionTypeAnnotation = FunctionTypeAnnotation; +exports.UpdateExpression = UpdateExpression; +exports.ObjectExpression = ObjectExpression; +exports.DoExpression = DoExpression; +exports.Binary = Binary; +exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation; +exports.TSAsExpression = TSAsExpression; +exports.TSTypeAssertion = TSTypeAssertion; +exports.TSIntersectionType = exports.TSUnionType = TSUnionType; +exports.TSInferType = TSInferType; +exports.BinaryExpression = BinaryExpression; +exports.SequenceExpression = SequenceExpression; +exports.AwaitExpression = exports.YieldExpression = YieldExpression; +exports.ClassExpression = ClassExpression; +exports.UnaryLike = UnaryLike; +exports.FunctionExpression = FunctionExpression; +exports.ArrowFunctionExpression = ArrowFunctionExpression; +exports.ConditionalExpression = ConditionalExpression; +exports.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemberExpression; +exports.AssignmentExpression = AssignmentExpression; +exports.LogicalExpression = LogicalExpression; + +var t = _interopRequireWildcard(require("@babel/types")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +const PRECEDENCE = { + "||": 0, + "??": 0, + "&&": 1, + "|": 2, + "^": 3, + "&": 4, + "==": 5, + "===": 5, + "!=": 5, + "!==": 5, + "<": 6, + ">": 6, + "<=": 6, + ">=": 6, + in: 6, + instanceof: 6, + ">>": 7, + "<<": 7, + ">>>": 7, + "+": 8, + "-": 8, + "*": 9, + "/": 9, + "%": 9, + "**": 10 +}; + +const isClassExtendsClause = (node, parent) => (t.isClassDeclaration(parent) || t.isClassExpression(parent)) && parent.superClass === node; + +const hasPostfixPart = (node, parent) => (t.isMemberExpression(parent) || t.isOptionalMemberExpression(parent)) && parent.object === node || (t.isCallExpression(parent) || t.isOptionalCallExpression(parent) || t.isNewExpression(parent)) && parent.callee === node || t.isTaggedTemplateExpression(parent) && parent.tag === node || t.isTSNonNullExpression(parent); + +function NullableTypeAnnotation(node, parent) { + return t.isArrayTypeAnnotation(parent); +} + +function FunctionTypeAnnotation(node, parent, printStack) { + return t.isUnionTypeAnnotation(parent) || t.isIntersectionTypeAnnotation(parent) || t.isArrayTypeAnnotation(parent) || t.isTypeAnnotation(parent) && t.isArrowFunctionExpression(printStack[printStack.length - 3]); +} + +function UpdateExpression(node, parent) { + return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent); +} + +function ObjectExpression(node, parent, printStack) { + return isFirstInStatement(printStack, { + considerArrow: true + }); +} + +function DoExpression(node, parent, printStack) { + return isFirstInStatement(printStack); +} + +function Binary(node, parent) { + if (node.operator === "**" && t.isBinaryExpression(parent, { + operator: "**" + })) { + return parent.left === node; + } + + if (isClassExtendsClause(node, parent)) { + return true; + } + + if (hasPostfixPart(node, parent) || t.isUnaryLike(parent) || t.isAwaitExpression(parent)) { + return true; + } + + if (t.isBinary(parent)) { + const parentOp = parent.operator; + const parentPos = PRECEDENCE[parentOp]; + const nodeOp = node.operator; + const nodePos = PRECEDENCE[nodeOp]; + + if (parentPos === nodePos && parent.right === node && !t.isLogicalExpression(parent) || parentPos > nodePos) { + return true; + } + } +} + +function UnionTypeAnnotation(node, parent) { + return t.isArrayTypeAnnotation(parent) || t.isNullableTypeAnnotation(parent) || t.isIntersectionTypeAnnotation(parent) || t.isUnionTypeAnnotation(parent); +} + +function TSAsExpression() { + return true; +} + +function TSTypeAssertion() { + return true; +} + +function TSUnionType(node, parent) { + return t.isTSArrayType(parent) || t.isTSOptionalType(parent) || t.isTSIntersectionType(parent) || t.isTSUnionType(parent) || t.isTSRestType(parent); +} + +function TSInferType(node, parent) { + return t.isTSArrayType(parent) || t.isTSOptionalType(parent); +} + +function BinaryExpression(node, parent) { + return node.operator === "in" && (t.isVariableDeclarator(parent) || t.isFor(parent)); +} + +function SequenceExpression(node, parent) { + if (t.isForStatement(parent) || t.isThrowStatement(parent) || t.isReturnStatement(parent) || t.isIfStatement(parent) && parent.test === node || t.isWhileStatement(parent) && parent.test === node || t.isForInStatement(parent) && parent.right === node || t.isSwitchStatement(parent) && parent.discriminant === node || t.isExpressionStatement(parent) && parent.expression === node) { + return false; + } + + return true; +} + +function YieldExpression(node, parent) { + return t.isBinary(parent) || t.isUnaryLike(parent) || hasPostfixPart(node, parent) || t.isAwaitExpression(parent) && t.isYieldExpression(node) || t.isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent); +} + +function ClassExpression(node, parent, printStack) { + return isFirstInStatement(printStack, { + considerDefaultExports: true + }); +} + +function UnaryLike(node, parent) { + return hasPostfixPart(node, parent) || t.isBinaryExpression(parent, { + operator: "**", + left: node + }) || isClassExtendsClause(node, parent); +} + +function FunctionExpression(node, parent, printStack) { + return isFirstInStatement(printStack, { + considerDefaultExports: true + }); +} + +function ArrowFunctionExpression(node, parent) { + return t.isExportDeclaration(parent) || ConditionalExpression(node, parent); +} + +function ConditionalExpression(node, parent) { + if (t.isUnaryLike(parent) || t.isBinary(parent) || t.isConditionalExpression(parent, { + test: node + }) || t.isAwaitExpression(parent) || t.isTSTypeAssertion(parent) || t.isTSAsExpression(parent)) { + return true; + } + + return UnaryLike(node, parent); +} + +function OptionalMemberExpression(node, parent) { + return t.isCallExpression(parent, { + callee: node + }) || t.isMemberExpression(parent, { + object: node + }); +} + +function AssignmentExpression(node, parent, printStack) { + if (t.isObjectPattern(node.left)) { + return true; + } else { + return ConditionalExpression(node, parent, printStack); + } +} + +function LogicalExpression(node, parent) { + switch (node.operator) { + case "||": + if (!t.isLogicalExpression(parent)) return false; + return parent.operator === "??" || parent.operator === "&&"; + + case "&&": + return t.isLogicalExpression(parent, { + operator: "??" + }); + + case "??": + return t.isLogicalExpression(parent) && parent.operator !== "??"; + } +} + +function isFirstInStatement(printStack, { + considerArrow = false, + considerDefaultExports = false +} = {}) { + let i = printStack.length - 1; + let node = printStack[i]; + i--; + let parent = printStack[i]; + + while (i >= 0) { + if (t.isExpressionStatement(parent, { + expression: node + }) || considerDefaultExports && t.isExportDefaultDeclaration(parent, { + declaration: node + }) || considerArrow && t.isArrowFunctionExpression(parent, { + body: node + })) { + return true; + } + + if (hasPostfixPart(node, parent) && !t.isNewExpression(parent) || t.isSequenceExpression(parent) && parent.expressions[0] === node || t.isConditional(parent, { + test: node + }) || t.isBinary(parent, { + left: node + }) || t.isAssignmentExpression(parent, { + left: node + })) { + node = parent; + i--; + parent = printStack[i]; + } else { + return false; + } + } + + return false; +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/node/whitespace.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/node/whitespace.js similarity index 53% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/node/whitespace.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/node/whitespace.js index 061218601cbbed..92efe538a76baa 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/node/whitespace.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/node/whitespace.js @@ -5,31 +5,25 @@ Object.defineProperty(exports, "__esModule", { }); exports.list = exports.nodes = void 0; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function crawl(node, state = {}) { - if (t().isMemberExpression(node)) { + if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) { crawl(node.object, state); if (node.computed) crawl(node.property, state); - } else if (t().isBinary(node) || t().isAssignmentExpression(node)) { + } else if (t.isBinary(node) || t.isAssignmentExpression(node)) { crawl(node.left, state); crawl(node.right, state); - } else if (t().isCallExpression(node)) { + } else if (t.isCallExpression(node) || t.isOptionalCallExpression(node)) { state.hasCall = true; crawl(node.callee, state); - } else if (t().isFunction(node)) { + } else if (t.isFunction(node)) { state.hasFunction = true; - } else if (t().isIdentifier(node)) { + } else if (t.isIdentifier(node)) { state.hasHelper = state.hasHelper || isHelper(node.callee); } @@ -37,21 +31,21 @@ function crawl(node, state = {}) { } function isHelper(node) { - if (t().isMemberExpression(node)) { + if (t.isMemberExpression(node)) { return isHelper(node.object) || isHelper(node.property); - } else if (t().isIdentifier(node)) { + } else if (t.isIdentifier(node)) { return node.name === "require" || node.name[0] === "_"; - } else if (t().isCallExpression(node)) { + } else if (t.isCallExpression(node)) { return isHelper(node.callee); - } else if (t().isBinary(node) || t().isAssignmentExpression(node)) { - return t().isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right); + } else if (t.isBinary(node) || t.isAssignmentExpression(node)) { + return t.isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right); } else { return false; } } function isType(node) { - return t().isLiteral(node) || t().isObjectExpression(node) || t().isArrayExpression(node) || t().isIdentifier(node) || t().isMemberExpression(node); + return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node); } const nodes = { @@ -74,7 +68,7 @@ const nodes = { }, LogicalExpression(node) { - if (t().isFunction(node.left) || t().isFunction(node.right)) { + if (t.isFunction(node.left) || t.isFunction(node.right)) { return { after: true }; @@ -90,7 +84,16 @@ const nodes = { }, CallExpression(node) { - if (t().isFunction(node.callee) || isHelper(node)) { + if (t.isFunction(node.callee) || isHelper(node)) { + return { + before: true, + after: true + }; + } + }, + + OptionalCallExpression(node) { + if (t.isFunction(node.callee)) { return { before: true, after: true @@ -118,7 +121,7 @@ const nodes = { }, IfStatement(node) { - if (t().isBlockStatement(node.consequent)) { + if (t.isBlockStatement(node.consequent)) { return { before: true, after: true @@ -138,7 +141,9 @@ nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function }; nodes.ObjectTypeCallProperty = function (node, parent) { - if (parent.callProperties[0] === node && (!parent.properties || !parent.properties.length)) { + var _parent$properties; + + if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) == null ? void 0 : _parent$properties.length)) { return { before: true }; @@ -146,7 +151,9 @@ nodes.ObjectTypeCallProperty = function (node, parent) { }; nodes.ObjectTypeIndexer = function (node, parent) { - if (parent.indexers[0] === node && (!parent.properties || !parent.properties.length) && (!parent.callProperties || !parent.callProperties.length)) { + var _parent$properties2, _parent$callPropertie; + + if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) == null ? void 0 : _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) == null ? void 0 : _parent$callPropertie.length)) { return { before: true }; @@ -154,7 +161,9 @@ nodes.ObjectTypeIndexer = function (node, parent) { }; nodes.ObjectTypeInternalSlot = function (node, parent) { - if (parent.internalSlots[0] === node && (!parent.properties || !parent.properties.length) && (!parent.callProperties || !parent.callProperties.length) && (!parent.indexers || !parent.indexers.length)) { + var _parent$properties3, _parent$callPropertie2, _parent$indexers; + + if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) == null ? void 0 : _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) == null ? void 0 : _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) == null ? void 0 : _parent$indexers.length)) { return { before: true }; @@ -184,7 +193,7 @@ exports.list = list; }; } - [type].concat(t().FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) { + [type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) { nodes[type] = function () { return amounts; }; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/printer.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/printer.js similarity index 74% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/printer.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/printer.js index 9458169f23ac26..65ccd2327d427f 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/printer.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/printer.js @@ -5,49 +5,24 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -function _isInteger() { - const data = _interopRequireDefault(require("lodash/isInteger")); - - _isInteger = function () { - return data; - }; - - return data; -} - -function _repeat() { - const data = _interopRequireDefault(require("lodash/repeat")); - - _repeat = function () { - return data; - }; - - return data; -} - var _buffer = _interopRequireDefault(require("./buffer")); var n = _interopRequireWildcard(require("./node")); -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} +var t = _interopRequireWildcard(require("@babel/types")); var generatorFunctions = _interopRequireWildcard(require("./generators")); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const SCIENTIFIC_NOTATION = /e/i; const ZERO_DECIMAL_INTEGER = /\.0+$/; const NON_DECIMAL_LITERAL = /^0[box]/; +const PURE_ANNOTATION_RE = /^\s*[@#]__PURE__\s*$/; class Printer { constructor(format, map) { @@ -120,7 +95,7 @@ class Printer { number(str) { this.word(str); - this._endsWithInteger = (0, _isInteger().default)(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== "."; + this._endsWithInteger = Number.isInteger(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== "."; } token(str) { @@ -205,19 +180,32 @@ class Printer { _maybeAddParen(str) { const parenPushNewlineState = this._parenPushNewlineState; if (!parenPushNewlineState) return; - this._parenPushNewlineState = null; let i; for (i = 0; i < str.length && str[i] === " "; i++) continue; - if (i === str.length) return; + if (i === str.length) { + return; + } + const cha = str[i]; if (cha !== "\n") { - if (cha !== "/") return; - if (i + 1 === str.length) return; + if (cha !== "/" || i + 1 === str.length) { + this._parenPushNewlineState = null; + return; + } + const chaPost = str[i + 1]; - if (chaPost !== "/" && chaPost !== "*") return; + + if (chaPost === "*") { + if (PURE_ANNOTATION_RE.test(str.slice(i + 2, str.length - 2))) { + return; + } + } else if (chaPost !== "/") { + this._parenPushNewlineState = null; + return; + } } this.token("("); @@ -229,7 +217,7 @@ class Printer { if (!this.format.retainLines) return; const pos = loc ? loc[prop] : null; - if (pos && pos.line !== null) { + if ((pos == null ? void 0 : pos.line) != null) { const count = pos.line - this._buf.getCurrentLine(); for (let i = 0; i < count; i++) { @@ -239,7 +227,7 @@ class Printer { } _getIndent() { - return (0, _repeat().default)(this.format.indent.style, this._indent); + return this.format.indent.style.repeat(this._indent); } startTerminatorless(isLabel = false) { @@ -256,7 +244,7 @@ class Printer { endTerminatorless(state) { this._noLineTerminator = false; - if (state && state.printed) { + if (state == null ? void 0 : state.printed) { this.dedent(); this.newline(); this.token(")"); @@ -274,7 +262,7 @@ class Printer { const printMethod = this[node.type]; if (!printMethod) { - throw new ReferenceError(`unknown node of type ${JSON.stringify(node.type)} with constructor ${JSON.stringify(node && node.constructor.name)}`); + throw new ReferenceError(`unknown node of type ${JSON.stringify(node.type)} with constructor ${JSON.stringify(node == null ? void 0 : node.constructor.name)}`); } this._printStack.push(node); @@ -294,7 +282,7 @@ class Printer { this._printLeadingComments(node); - const loc = t().isProgram(node) || t().isFile(node) ? null : node.loc; + const loc = t.isProgram(node) || t.isFile(node) ? null : node.loc; this.withSource("start", loc, () => { printMethod.call(this, node, parent); }); @@ -349,7 +337,7 @@ class Printer { } printJoin(nodes, parent, opts = {}) { - if (!nodes || !nodes.length) return; + if (!(nodes == null ? void 0 : nodes.length)) return; if (opts.indent) this.indent(); const newlineOpts = { addNewlines: opts.addNewlines @@ -385,7 +373,7 @@ class Printer { printBlock(parent) { const node = parent.body; - if (!t().isEmptyStatement(node)) { + if (!t.isEmptyStatement(node)) { this.space(); } @@ -397,11 +385,13 @@ class Printer { } _printLeadingComments(node) { - this._printComments(this._getComments(true, node)); + this._printComments(this._getComments(true, node), true); } printInnerComments(node, indent = true) { - if (!node.innerComments || !node.innerComments.length) return; + var _node$innerComments; + + if (!((_node$innerComments = node.innerComments) == null ? void 0 : _node$innerComments.length)) return; if (indent) this.indent(); this._printComments(node.innerComments); @@ -446,7 +436,7 @@ class Printer { return node && (leading ? node.leadingComments : node.trailingComments) || []; } - _printComment(comment) { + _printComment(comment, skipNewLines) { if (!this.format.shouldPrintComment(comment.value)) return; if (comment.ignore) return; if (this._printedComments.has(comment)) return; @@ -459,34 +449,56 @@ class Printer { } const isBlockComment = comment.type === "CommentBlock"; - this.newline(this._buf.hasContent() && !this._noLineTerminator && isBlockComment ? 1 : 0); + const printNewLines = isBlockComment && !skipNewLines && !this._noLineTerminator; + if (printNewLines && this._buf.hasContent()) this.newline(1); if (!this.endsWith("[") && !this.endsWith("{")) this.space(); let val = !isBlockComment && !this._noLineTerminator ? `//${comment.value}\n` : `/*${comment.value}*/`; if (isBlockComment && this.format.indent.adjustMultilineComment) { - const offset = comment.loc && comment.loc.start.column; + var _comment$loc; + + const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column; if (offset) { const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g"); val = val.replace(newlineRegex, "\n"); } - const indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn()); - val = val.replace(/\n(?!$)/g, `\n${(0, _repeat().default)(" ", indentSize)}`); + const indentSize = Math.max(this._getIndent().length, this.format.retainLines ? 0 : this._buf.getCurrentColumn()); + val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`); } if (this.endsWith("/")) this._space(); this.withSource("start", comment.loc, () => { this._append(val); }); - this.newline(isBlockComment && !this._noLineTerminator ? 1 : 0); + if (printNewLines) this.newline(1); + } + + _printComments(comments, inlinePureAnnotation) { + if (!(comments == null ? void 0 : comments.length)) return; + + if (inlinePureAnnotation && comments.length === 1 && PURE_ANNOTATION_RE.test(comments[0].value)) { + this._printComment(comments[0], this._buf.hasContent() && !this.endsWith("\n")); + } else { + for (const comment of comments) { + this._printComment(comment); + } + } } - _printComments(comments) { - if (!comments || !comments.length) return; + printAssertions(node) { + var _node$assertions; - for (const comment of comments) { - this._printComment(comment); + if ((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) { + this.space(); + this.word("assert"); + this.space(); + this.token("{"); + this.space(); + this.printList(node.assertions, node); + this.space(); + this.token("}"); } } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/source-map.js b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/source-map.js similarity index 74% rename from tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/source-map.js rename to tools/node_modules/@babel/core/node_modules/@babel/generator/lib/source-map.js index 12b70308db4b73..7a0a240b0e45ef 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/source-map.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/lib/source-map.js @@ -5,15 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -function _sourceMap() { - const data = _interopRequireDefault(require("source-map")); - - _sourceMap = function () { - return data; - }; - - return data; -} +var _sourceMap = _interopRequireDefault(require("source-map")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -27,20 +19,20 @@ class SourceMap { get() { if (!this._cachedMap) { - const map = this._cachedMap = new (_sourceMap().default.SourceMapGenerator)({ + const map = this._cachedMap = new _sourceMap.default.SourceMapGenerator({ sourceRoot: this._opts.sourceRoot }); const code = this._code; if (typeof code === "string") { - map.setSourceContent(this._opts.sourceFileName, code); + map.setSourceContent(this._opts.sourceFileName.replace(/\\/g, "/"), code); } else if (typeof code === "object") { Object.keys(code).forEach(sourceFileName => { - map.setSourceContent(sourceFileName, code[sourceFileName]); + map.setSourceContent(sourceFileName.replace(/\\/g, "/"), code[sourceFileName]); }); } - this._rawMappings.forEach(map.addMapping, map); + this._rawMappings.forEach(mapping => map.addMapping(mapping), map); } return this._cachedMap.toJSON(); @@ -68,7 +60,7 @@ class SourceMap { line: generatedLine, column: generatedColumn }, - source: line == null ? undefined : filename || this._opts.sourceFileName, + source: line == null ? undefined : (filename || this._opts.sourceFileName).replace(/\\/g, "/"), original: line == null ? undefined : { line: line, column: column diff --git a/tools/node_modules/@babel/core/node_modules/@babel/generator/package.json b/tools/node_modules/@babel/core/node_modules/@babel/generator/package.json new file mode 100644 index 00000000000000..b76c14e291015c --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/generator/package.json @@ -0,0 +1,29 @@ +{ + "name": "@babel/generator", + "version": "7.12.5", + "description": "Turns an AST into code.", + "author": "Sebastian McKenzie ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-generator" + }, + "main": "lib/index.js", + "files": [ + "lib" + ], + "dependencies": { + "@babel/types": "^7.12.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "devDependencies": { + "@babel/helper-fixtures": "7.10.5", + "@babel/parser": "7.12.5" + } +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/highlight/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/helper-function-name/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/highlight/LICENSE rename to tools/node_modules/@babel/core/node_modules/@babel/helper-function-name/LICENSE diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/README.md b/tools/node_modules/@babel/core/node_modules/@babel/helper-function-name/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/README.md rename to tools/node_modules/@babel/core/node_modules/@babel/helper-function-name/README.md diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-function-name/lib/index.js similarity index 62% rename from tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/lib/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/helper-function-name/lib/index.js index c6dd4afbf55a5c..00e1b5573ab64a 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/lib/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-function-name/lib/index.js @@ -5,41 +5,19 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = _default; -function _helperGetFunctionArity() { - const data = _interopRequireDefault(require("@babel/helper-get-function-arity")); +var _helperGetFunctionArity = _interopRequireDefault(require("@babel/helper-get-function-arity")); - _helperGetFunctionArity = function () { - return data; - }; - - return data; -} +var _template = _interopRequireDefault(require("@babel/template")); -function _template() { - const data = _interopRequireDefault(require("@babel/template")); +var t = _interopRequireWildcard(require("@babel/types")); - _template = function () { - return data; - }; - - return data; -} - -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const buildPropertyMethodAssignmentWrapper = (0, _template().default)(` +const buildPropertyMethodAssignmentWrapper = (0, _template.default)(` (function (FUNCTION_KEY) { function FUNCTION_ID() { return FUNCTION_KEY.apply(this, arguments); @@ -52,7 +30,7 @@ const buildPropertyMethodAssignmentWrapper = (0, _template().default)(` return FUNCTION_ID; })(FUNCTION) `); -const buildGeneratorPropertyMethodAssignmentWrapper = (0, _template().default)(` +const buildGeneratorPropertyMethodAssignmentWrapper = (0, _template.default)(` (function (FUNCTION_KEY) { function* FUNCTION_ID() { return yield* FUNCTION_KEY.apply(this, arguments); @@ -77,15 +55,15 @@ const visitor = { }; function getNameFromLiteralId(id) { - if (t().isNullLiteral(id)) { + if (t.isNullLiteral(id)) { return "null"; } - if (t().isRegExpLiteral(id)) { + if (t.isRegExpLiteral(id)) { return `_${id.pattern}_${id.flags}`; } - if (t().isTemplateLiteral(id)) { + if (t.isTemplateLiteral(id)) { return id.quasis.map(quasi => quasi.value.raw).join(""); } @@ -101,7 +79,7 @@ function wrap(state, method, id, scope) { if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) { scope.rename(id.name); } else { - if (!t().isFunction(method)) return; + if (!t.isFunction(method)) return; let build = buildPropertyMethodAssignmentWrapper; if (method.generator) { @@ -115,7 +93,7 @@ function wrap(state, method, id, scope) { }).expression; const params = template.callee.body.body[0].params; - for (let i = 0, len = (0, _helperGetFunctionArity().default)(method); i < len; i++) { + for (let i = 0, len = (0, _helperGetFunctionArity.default)(method); i < len; i++) { params.push(scope.generateUidIdentifier("x")); } @@ -156,23 +134,25 @@ function _default({ }, localBinding = false) { if (node.id) return; - if ((t().isObjectProperty(parent) || t().isObjectMethod(parent, { + if ((t.isObjectProperty(parent) || t.isObjectMethod(parent, { kind: "method" - })) && (!parent.computed || t().isLiteral(parent.key))) { + })) && (!parent.computed || t.isLiteral(parent.key))) { id = parent.key; - } else if (t().isVariableDeclarator(parent)) { + } else if (t.isVariableDeclarator(parent)) { id = parent.id; - if (t().isIdentifier(id) && !localBinding) { + if (t.isIdentifier(id) && !localBinding) { const binding = scope.parent.getBinding(id.name); if (binding && binding.constant && scope.getBinding(id.name) === binding) { - node.id = t().cloneNode(id); - node.id[t().NOT_LOCAL_BINDING] = true; + node.id = t.cloneNode(id); + node.id[t.NOT_LOCAL_BINDING] = true; return; } } - } else if (t().isAssignmentExpression(parent)) { + } else if (t.isAssignmentExpression(parent, { + operator: "=" + })) { id = parent.left; } else if (!id) { return; @@ -180,9 +160,9 @@ function _default({ let name; - if (id && t().isLiteral(id)) { + if (id && t.isLiteral(id)) { name = getNameFromLiteralId(id); - } else if (id && t().isIdentifier(id)) { + } else if (id && t.isIdentifier(id)) { name = id.name; } @@ -190,9 +170,9 @@ function _default({ return; } - name = t().toBindingIdentifierName(name); - id = t().identifier(name); - id[t().NOT_LOCAL_BINDING] = true; + name = t.toBindingIdentifierName(name); + id = t.identifier(name); + id[t.NOT_LOCAL_BINDING] = true; const state = visit(node, name, scope); return wrap(state, node, id, scope) || node; } \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-function-name/package.json b/tools/node_modules/@babel/core/node_modules/@babel/helper-function-name/package.json new file mode 100644 index 00000000000000..98c7f62ce193d4 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-function-name/package.json @@ -0,0 +1,21 @@ +{ + "name": "@babel/helper-function-name", + "version": "7.10.4", + "description": "Helper function to change the property 'name' of every function", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-function-name" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df" +} diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/template/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/template/LICENSE rename to tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/LICENSE diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/README.md b/tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/README.md rename to tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/README.md diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/lib/index.js new file mode 100644 index 00000000000000..46e71dce2bff0e --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/lib/index.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; + +var t = _interopRequireWildcard(require("@babel/types")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _default(node) { + const params = node.params; + + for (let i = 0; i < params.length; i++) { + const param = params[i]; + + if (t.isAssignmentPattern(param) || t.isRestElement(param)) { + return i; + } + } + + return params.length; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/package.json b/tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/package.json new file mode 100644 index 00000000000000..6b53c0b74b3b71 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/package.json @@ -0,0 +1,19 @@ +{ + "name": "@babel/helper-get-function-arity", + "version": "7.10.4", + "description": "Helper function to get function arity", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-get-function-arity" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.10.4" + }, + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df" +} diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/LICENSE rename to tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/LICENSE diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/README.md b/tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/README.md new file mode 100644 index 00000000000000..01c551d6a96030 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/README.md @@ -0,0 +1,19 @@ +# @babel/helper-member-expression-to-functions + +> Helper function to replace certain member expressions with function calls + +See our website [@babel/helper-member-expression-to-functions](https://babeljs.io/docs/en/babel-helper-member-expression-to-functions) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/helper-member-expression-to-functions +``` + +or using yarn: + +```sh +yarn add @babel/helper-member-expression-to-functions --dev +``` diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/lib/index.js new file mode 100644 index 00000000000000..827d7a2d2cd4a4 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/lib/index.js @@ -0,0 +1,386 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var t = require('@babel/types'); + +function willPathCastToBoolean(path) { + const maybeWrapped = path; + const { + node, + parentPath + } = maybeWrapped; + + if (parentPath.isLogicalExpression()) { + const { + operator, + right + } = parentPath.node; + + if (operator === "&&" || operator === "||" || operator === "??" && node === right) { + return willPathCastToBoolean(parentPath); + } + } + + if (parentPath.isSequenceExpression()) { + const { + expressions + } = parentPath.node; + + if (expressions[expressions.length - 1] === node) { + return willPathCastToBoolean(parentPath); + } else { + return true; + } + } + + return parentPath.isConditional({ + test: node + }) || parentPath.isUnaryExpression({ + operator: "!" + }) || parentPath.isLoop({ + test: node + }); +} + +class AssignmentMemoiser { + constructor() { + this._map = new WeakMap(); + } + + has(key) { + return this._map.has(key); + } + + get(key) { + if (!this.has(key)) return; + + const record = this._map.get(key); + + const { + value + } = record; + record.count--; + + if (record.count === 0) { + return t.assignmentExpression("=", value, key); + } + + return value; + } + + set(key, value, count) { + return this._map.set(key, { + count, + value + }); + } + +} + +function toNonOptional(path, base) { + const { + node + } = path; + + if (path.isOptionalMemberExpression()) { + return t.memberExpression(base, node.property, node.computed); + } + + if (path.isOptionalCallExpression()) { + const callee = path.get("callee"); + + if (path.node.optional && callee.isOptionalMemberExpression()) { + const { + object + } = callee.node; + const context = path.scope.maybeGenerateMemoised(object) || object; + callee.get("object").replaceWith(t.assignmentExpression("=", context, object)); + return t.callExpression(t.memberExpression(base, t.identifier("call")), [context, ...node.arguments]); + } + + return t.callExpression(base, node.arguments); + } + + return path.node; +} + +function isInDetachedTree(path) { + while (path) { + if (path.isProgram()) break; + const { + parentPath, + container, + listKey + } = path; + const parentNode = parentPath.node; + + if (listKey) { + if (container !== parentNode[listKey]) return true; + } else { + if (container !== parentNode) return true; + } + + path = parentPath; + } + + return false; +} + +const handle = { + memoise() {}, + + handle(member) { + const { + node, + parent, + parentPath, + scope + } = member; + + if (member.isOptionalMemberExpression()) { + if (isInDetachedTree(member)) return; + const endPath = member.find(({ + node, + parent, + parentPath + }) => { + if (parentPath.isOptionalMemberExpression()) { + return parent.optional || parent.object !== node; + } + + if (parentPath.isOptionalCallExpression()) { + return node !== member.node && parent.optional || parent.callee !== node; + } + + return true; + }); + + if (scope.path.isPattern()) { + endPath.replaceWith(t.callExpression(t.arrowFunctionExpression([], endPath.node), [])); + return; + } + + const willEndPathCastToBoolean = willPathCastToBoolean(endPath); + const rootParentPath = endPath.parentPath; + + if (rootParentPath.isUpdateExpression({ + argument: node + }) || rootParentPath.isAssignmentExpression({ + left: node + })) { + throw member.buildCodeFrameError(`can't handle assignment`); + } + + const isDeleteOperation = rootParentPath.isUnaryExpression({ + operator: "delete" + }); + + if (isDeleteOperation && endPath.isOptionalMemberExpression() && endPath.get("property").isPrivateName()) { + throw member.buildCodeFrameError(`can't delete a private class element`); + } + + let startingOptional = member; + + for (;;) { + if (startingOptional.isOptionalMemberExpression()) { + if (startingOptional.node.optional) break; + startingOptional = startingOptional.get("object"); + continue; + } else if (startingOptional.isOptionalCallExpression()) { + if (startingOptional.node.optional) break; + startingOptional = startingOptional.get("callee"); + continue; + } + + throw new Error(`Internal error: unexpected ${startingOptional.node.type}`); + } + + const startingProp = startingOptional.isOptionalMemberExpression() ? "object" : "callee"; + const startingNode = startingOptional.node[startingProp]; + const baseNeedsMemoised = scope.maybeGenerateMemoised(startingNode); + const baseRef = baseNeedsMemoised != null ? baseNeedsMemoised : startingNode; + const parentIsOptionalCall = parentPath.isOptionalCallExpression({ + callee: node + }); + const parentIsCall = parentPath.isCallExpression({ + callee: node + }); + startingOptional.replaceWith(toNonOptional(startingOptional, baseRef)); + + if (parentIsOptionalCall) { + if (parent.optional) { + parentPath.replaceWith(this.optionalCall(member, parent.arguments)); + } else { + parentPath.replaceWith(this.call(member, parent.arguments)); + } + } else if (parentIsCall) { + member.replaceWith(this.boundGet(member)); + } else { + member.replaceWith(this.get(member)); + } + + let regular = member.node; + + for (let current = member; current !== endPath;) { + const { + parentPath + } = current; + + if (parentPath === endPath && parentIsOptionalCall && parent.optional) { + regular = parentPath.node; + break; + } + + regular = toNonOptional(parentPath, regular); + current = parentPath; + } + + let context; + const endParentPath = endPath.parentPath; + + if (t.isMemberExpression(regular) && endParentPath.isOptionalCallExpression({ + callee: endPath.node, + optional: true + })) { + const { + object + } = regular; + context = member.scope.maybeGenerateMemoised(object); + + if (context) { + regular.object = t.assignmentExpression("=", context, object); + } + } + + let replacementPath = endPath; + + if (isDeleteOperation) { + replacementPath = endParentPath; + regular = endParentPath.node; + } + + if (willEndPathCastToBoolean) { + const nonNullishCheck = t.logicalExpression("&&", t.binaryExpression("!==", baseNeedsMemoised ? t.assignmentExpression("=", t.cloneNode(baseRef), t.cloneNode(startingNode)) : t.cloneNode(baseRef), t.nullLiteral()), t.binaryExpression("!==", t.cloneNode(baseRef), scope.buildUndefinedNode())); + replacementPath.replaceWith(t.logicalExpression("&&", nonNullishCheck, regular)); + } else { + const nullishCheck = t.logicalExpression("||", t.binaryExpression("===", baseNeedsMemoised ? t.assignmentExpression("=", t.cloneNode(baseRef), t.cloneNode(startingNode)) : t.cloneNode(baseRef), t.nullLiteral()), t.binaryExpression("===", t.cloneNode(baseRef), scope.buildUndefinedNode())); + replacementPath.replaceWith(t.conditionalExpression(nullishCheck, isDeleteOperation ? t.booleanLiteral(true) : scope.buildUndefinedNode(), regular)); + } + + if (context) { + const endParent = endParentPath.node; + endParentPath.replaceWith(t.optionalCallExpression(t.optionalMemberExpression(endParent.callee, t.identifier("call"), false, true), [t.cloneNode(context), ...endParent.arguments], false)); + } + + return; + } + + if (parentPath.isUpdateExpression({ + argument: node + })) { + if (this.simpleSet) { + member.replaceWith(this.simpleSet(member)); + return; + } + + const { + operator, + prefix + } = parent; + this.memoise(member, 2); + const value = t.binaryExpression(operator[0], t.unaryExpression("+", this.get(member)), t.numericLiteral(1)); + + if (prefix) { + parentPath.replaceWith(this.set(member, value)); + } else { + const { + scope + } = member; + const ref = scope.generateUidIdentifierBasedOnNode(node); + scope.push({ + id: ref + }); + value.left = t.assignmentExpression("=", t.cloneNode(ref), value.left); + parentPath.replaceWith(t.sequenceExpression([this.set(member, value), t.cloneNode(ref)])); + } + + return; + } + + if (parentPath.isAssignmentExpression({ + left: node + })) { + if (this.simpleSet) { + member.replaceWith(this.simpleSet(member)); + return; + } + + const { + operator, + right: value + } = parent; + + if (operator === "=") { + parentPath.replaceWith(this.set(member, value)); + } else { + const operatorTrunc = operator.slice(0, -1); + + if (t.LOGICAL_OPERATORS.includes(operatorTrunc)) { + this.memoise(member, 1); + parentPath.replaceWith(t.logicalExpression(operatorTrunc, this.get(member), this.set(member, value))); + } else { + this.memoise(member, 2); + parentPath.replaceWith(this.set(member, t.binaryExpression(operatorTrunc, this.get(member), value))); + } + } + + return; + } + + if (parentPath.isCallExpression({ + callee: node + })) { + parentPath.replaceWith(this.call(member, parent.arguments)); + return; + } + + if (parentPath.isOptionalCallExpression({ + callee: node + })) { + if (scope.path.isPattern()) { + parentPath.replaceWith(t.callExpression(t.arrowFunctionExpression([], parentPath.node), [])); + return; + } + + parentPath.replaceWith(this.optionalCall(member, parent.arguments)); + return; + } + + if (parentPath.isForXStatement({ + left: node + }) || parentPath.isObjectProperty({ + value: node + }) && parentPath.parentPath.isObjectPattern() || parentPath.isAssignmentPattern({ + left: node + }) && parentPath.parentPath.isObjectProperty({ + value: parent + }) && parentPath.parentPath.parentPath.isObjectPattern() || parentPath.isArrayPattern() || parentPath.isAssignmentPattern({ + left: node + }) && parentPath.parentPath.isArrayPattern() || parentPath.isRestElement()) { + member.replaceWith(this.destructureSet(member)); + return; + } + + member.replaceWith(this.get(member)); + } + +}; +function memberExpressionToFunctions(path, visitor, state) { + path.traverse(visitor, Object.assign({}, handle, state, { + memoiser: new AssignmentMemoiser() + })); +} + +exports.default = memberExpressionToFunctions; +//# sourceMappingURL=index.js.map diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/package.json b/tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/package.json new file mode 100644 index 00000000000000..607d85d5dcbfef --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-member-expression-to-functions/package.json @@ -0,0 +1,19 @@ +{ + "name": "@babel/helper-member-expression-to-functions", + "version": "7.12.7", + "description": "Helper function to replace certain member expressions with function calls", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-member-expression-to-functions" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "author": "Justin Ridgewell ", + "dependencies": { + "@babel/types": "^7.12.7" + } +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/LICENSE rename to tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/LICENSE diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/README.md b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/README.md new file mode 100644 index 00000000000000..dfc0bb88cf5aa1 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/README.md @@ -0,0 +1,19 @@ +# @babel/helper-module-imports + +> Babel helper functions for inserting module loads + +See our website [@babel/helper-module-imports](https://babeljs.io/docs/en/babel-helper-module-imports) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/helper-module-imports +``` + +or using yarn: + +```sh +yarn add @babel/helper-module-imports --dev +``` diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/import-builder.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/import-builder.js new file mode 100644 index 00000000000000..4fed51ec96d351 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/import-builder.js @@ -0,0 +1,139 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _assert = _interopRequireDefault(require("assert")); + +var t = _interopRequireWildcard(require("@babel/types")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class ImportBuilder { + constructor(importedSource, scope, hub) { + this._statements = []; + this._resultName = null; + this._scope = null; + this._hub = null; + this._scope = scope; + this._hub = hub; + this._importedSource = importedSource; + } + + done() { + return { + statements: this._statements, + resultName: this._resultName + }; + } + + import() { + this._statements.push(t.importDeclaration([], t.stringLiteral(this._importedSource))); + + return this; + } + + require() { + this._statements.push(t.expressionStatement(t.callExpression(t.identifier("require"), [t.stringLiteral(this._importedSource)]))); + + return this; + } + + namespace(name = "namespace") { + name = this._scope.generateUidIdentifier(name); + const statement = this._statements[this._statements.length - 1]; + (0, _assert.default)(statement.type === "ImportDeclaration"); + (0, _assert.default)(statement.specifiers.length === 0); + statement.specifiers = [t.importNamespaceSpecifier(name)]; + this._resultName = t.cloneNode(name); + return this; + } + + default(name) { + name = this._scope.generateUidIdentifier(name); + const statement = this._statements[this._statements.length - 1]; + (0, _assert.default)(statement.type === "ImportDeclaration"); + (0, _assert.default)(statement.specifiers.length === 0); + statement.specifiers = [t.importDefaultSpecifier(name)]; + this._resultName = t.cloneNode(name); + return this; + } + + named(name, importName) { + if (importName === "default") return this.default(name); + name = this._scope.generateUidIdentifier(name); + const statement = this._statements[this._statements.length - 1]; + (0, _assert.default)(statement.type === "ImportDeclaration"); + (0, _assert.default)(statement.specifiers.length === 0); + statement.specifiers = [t.importSpecifier(name, t.identifier(importName))]; + this._resultName = t.cloneNode(name); + return this; + } + + var(name) { + name = this._scope.generateUidIdentifier(name); + let statement = this._statements[this._statements.length - 1]; + + if (statement.type !== "ExpressionStatement") { + (0, _assert.default)(this._resultName); + statement = t.expressionStatement(this._resultName); + + this._statements.push(statement); + } + + this._statements[this._statements.length - 1] = t.variableDeclaration("var", [t.variableDeclarator(name, statement.expression)]); + this._resultName = t.cloneNode(name); + return this; + } + + defaultInterop() { + return this._interop(this._hub.addHelper("interopRequireDefault")); + } + + wildcardInterop() { + return this._interop(this._hub.addHelper("interopRequireWildcard")); + } + + _interop(callee) { + const statement = this._statements[this._statements.length - 1]; + + if (statement.type === "ExpressionStatement") { + statement.expression = t.callExpression(callee, [statement.expression]); + } else if (statement.type === "VariableDeclaration") { + (0, _assert.default)(statement.declarations.length === 1); + statement.declarations[0].init = t.callExpression(callee, [statement.declarations[0].init]); + } else { + _assert.default.fail("Unexpected type."); + } + + return this; + } + + prop(name) { + const statement = this._statements[this._statements.length - 1]; + + if (statement.type === "ExpressionStatement") { + statement.expression = t.memberExpression(statement.expression, t.identifier(name)); + } else if (statement.type === "VariableDeclaration") { + (0, _assert.default)(statement.declarations.length === 1); + statement.declarations[0].init = t.memberExpression(statement.declarations[0].init, t.identifier(name)); + } else { + _assert.default.fail("Unexpected type:" + statement.type); + } + + return this; + } + + read(name) { + this._resultName = t.memberExpression(this._resultName, t.identifier(name)); + } + +} + +exports.default = ImportBuilder; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/import-injector.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/import-injector.js new file mode 100644 index 00000000000000..1e983caed62889 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/import-injector.js @@ -0,0 +1,271 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _assert = _interopRequireDefault(require("assert")); + +var t = _interopRequireWildcard(require("@babel/types")); + +var _importBuilder = _interopRequireDefault(require("./import-builder")); + +var _isModule = _interopRequireDefault(require("./is-module")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class ImportInjector { + constructor(path, importedSource, opts) { + this._defaultOpts = { + importedSource: null, + importedType: "commonjs", + importedInterop: "babel", + importingInterop: "babel", + ensureLiveReference: false, + ensureNoContext: false + }; + const programPath = path.find(p => p.isProgram()); + this._programPath = programPath; + this._programScope = programPath.scope; + this._hub = programPath.hub; + this._defaultOpts = this._applyDefaults(importedSource, opts, true); + } + + addDefault(importedSourceIn, opts) { + return this.addNamed("default", importedSourceIn, opts); + } + + addNamed(importName, importedSourceIn, opts) { + (0, _assert.default)(typeof importName === "string"); + return this._generateImport(this._applyDefaults(importedSourceIn, opts), importName); + } + + addNamespace(importedSourceIn, opts) { + return this._generateImport(this._applyDefaults(importedSourceIn, opts), null); + } + + addSideEffect(importedSourceIn, opts) { + return this._generateImport(this._applyDefaults(importedSourceIn, opts), false); + } + + _applyDefaults(importedSource, opts, isInit = false) { + const optsList = []; + + if (typeof importedSource === "string") { + optsList.push({ + importedSource + }); + optsList.push(opts); + } else { + (0, _assert.default)(!opts, "Unexpected secondary arguments."); + optsList.push(importedSource); + } + + const newOpts = Object.assign({}, this._defaultOpts); + + for (const opts of optsList) { + if (!opts) continue; + Object.keys(newOpts).forEach(key => { + if (opts[key] !== undefined) newOpts[key] = opts[key]; + }); + + if (!isInit) { + if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint; + if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist; + } + } + + return newOpts; + } + + _generateImport(opts, importName) { + const isDefault = importName === "default"; + const isNamed = !!importName && !isDefault; + const isNamespace = importName === null; + const { + importedSource, + importedType, + importedInterop, + importingInterop, + ensureLiveReference, + ensureNoContext, + nameHint, + blockHoist + } = opts; + let name = nameHint || importName; + const isMod = (0, _isModule.default)(this._programPath); + const isModuleForNode = isMod && importingInterop === "node"; + const isModuleForBabel = isMod && importingInterop === "babel"; + const builder = new _importBuilder.default(importedSource, this._programScope, this._hub); + + if (importedType === "es6") { + if (!isModuleForNode && !isModuleForBabel) { + throw new Error("Cannot import an ES6 module from CommonJS"); + } + + builder.import(); + + if (isNamespace) { + builder.namespace(nameHint || importedSource); + } else if (isDefault || isNamed) { + builder.named(name, importName); + } + } else if (importedType !== "commonjs") { + throw new Error(`Unexpected interopType "${importedType}"`); + } else if (importedInterop === "babel") { + if (isModuleForNode) { + name = name !== "default" ? name : importedSource; + const es6Default = `${importedSource}$es6Default`; + builder.import(); + + if (isNamespace) { + builder.default(es6Default).var(name || importedSource).wildcardInterop(); + } else if (isDefault) { + if (ensureLiveReference) { + builder.default(es6Default).var(name || importedSource).defaultInterop().read("default"); + } else { + builder.default(es6Default).var(name).defaultInterop().prop(importName); + } + } else if (isNamed) { + builder.default(es6Default).read(importName); + } + } else if (isModuleForBabel) { + builder.import(); + + if (isNamespace) { + builder.namespace(name || importedSource); + } else if (isDefault || isNamed) { + builder.named(name, importName); + } + } else { + builder.require(); + + if (isNamespace) { + builder.var(name || importedSource).wildcardInterop(); + } else if ((isDefault || isNamed) && ensureLiveReference) { + if (isDefault) { + name = name !== "default" ? name : importedSource; + builder.var(name).read(importName); + builder.defaultInterop(); + } else { + builder.var(importedSource).read(importName); + } + } else if (isDefault) { + builder.var(name).defaultInterop().prop(importName); + } else if (isNamed) { + builder.var(name).prop(importName); + } + } + } else if (importedInterop === "compiled") { + if (isModuleForNode) { + builder.import(); + + if (isNamespace) { + builder.default(name || importedSource); + } else if (isDefault || isNamed) { + builder.default(importedSource).read(name); + } + } else if (isModuleForBabel) { + builder.import(); + + if (isNamespace) { + builder.namespace(name || importedSource); + } else if (isDefault || isNamed) { + builder.named(name, importName); + } + } else { + builder.require(); + + if (isNamespace) { + builder.var(name || importedSource); + } else if (isDefault || isNamed) { + if (ensureLiveReference) { + builder.var(importedSource).read(name); + } else { + builder.prop(importName).var(name); + } + } + } + } else if (importedInterop === "uncompiled") { + if (isDefault && ensureLiveReference) { + throw new Error("No live reference for commonjs default"); + } + + if (isModuleForNode) { + builder.import(); + + if (isNamespace) { + builder.default(name || importedSource); + } else if (isDefault) { + builder.default(name); + } else if (isNamed) { + builder.default(importedSource).read(name); + } + } else if (isModuleForBabel) { + builder.import(); + + if (isNamespace) { + builder.default(name || importedSource); + } else if (isDefault) { + builder.default(name); + } else if (isNamed) { + builder.named(name, importName); + } + } else { + builder.require(); + + if (isNamespace) { + builder.var(name || importedSource); + } else if (isDefault) { + builder.var(name); + } else if (isNamed) { + if (ensureLiveReference) { + builder.var(importedSource).read(name); + } else { + builder.var(name).prop(importName); + } + } + } + } else { + throw new Error(`Unknown importedInterop "${importedInterop}".`); + } + + const { + statements, + resultName + } = builder.done(); + + this._insertStatements(statements, blockHoist); + + if ((isDefault || isNamed) && ensureNoContext && resultName.type !== "Identifier") { + return t.sequenceExpression([t.numericLiteral(0), resultName]); + } + + return resultName; + } + + _insertStatements(statements, blockHoist = 3) { + statements.forEach(node => { + node._blockHoist = blockHoist; + }); + + const targetPath = this._programPath.get("body").find(p => { + const val = p.node._blockHoist; + return Number.isFinite(val) && val < 4; + }); + + if (targetPath) { + targetPath.insertBefore(statements); + } else { + this._programPath.unshiftContainer("body", statements); + } + } + +} + +exports.default = ImportInjector; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/index.js new file mode 100644 index 00000000000000..50e1e98085362a --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/index.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addDefault = addDefault; +exports.addNamed = addNamed; +exports.addNamespace = addNamespace; +exports.addSideEffect = addSideEffect; +Object.defineProperty(exports, "ImportInjector", { + enumerable: true, + get: function () { + return _importInjector.default; + } +}); +Object.defineProperty(exports, "isModule", { + enumerable: true, + get: function () { + return _isModule.default; + } +}); + +var _importInjector = _interopRequireDefault(require("./import-injector")); + +var _isModule = _interopRequireDefault(require("./is-module")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function addDefault(path, importedSource, opts) { + return new _importInjector.default(path).addDefault(importedSource, opts); +} + +function addNamed(path, name, importedSource, opts) { + return new _importInjector.default(path).addNamed(name, importedSource, opts); +} + +function addNamespace(path, importedSource, opts) { + return new _importInjector.default(path).addNamespace(importedSource, opts); +} + +function addSideEffect(path, importedSource, opts) { + return new _importInjector.default(path).addSideEffect(importedSource, opts); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/is-module.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/is-module.js new file mode 100644 index 00000000000000..ad9e399540f114 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/lib/is-module.js @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isModule; + +function isModule(path) { + const { + sourceType + } = path.node; + + if (sourceType !== "module" && sourceType !== "script") { + throw path.buildCodeFrameError(`Unknown sourceType "${sourceType}", cannot transform.`); + } + + return path.node.sourceType === "module"; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/package.json b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/package.json new file mode 100644 index 00000000000000..a2de4d9dbd479a --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-imports/package.json @@ -0,0 +1,23 @@ +{ + "name": "@babel/helper-module-imports", + "version": "7.12.5", + "description": "Babel helper functions for inserting module loads", + "author": "Logan Smyth ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-module-imports" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.12.5" + }, + "devDependencies": { + "@babel/core": "7.12.3" + } +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/LICENSE similarity index 93% rename from tools/node_modules/babel-eslint/LICENSE rename to tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/LICENSE index 80194a854b944c..f31575ec773bb1 100644 --- a/tools/node_modules/babel-eslint/LICENSE +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/LICENSE @@ -1,7 +1,7 @@ -Copyright (c) 2014-2016 Sebastian McKenzie - 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 diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/README.md b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/README.md new file mode 100644 index 00000000000000..8dfc1bda1d7a06 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/README.md @@ -0,0 +1,19 @@ +# @babel/helper-module-transforms + +> Babel helper functions for implementing ES6 module transformations + +See our website [@babel/helper-module-transforms](https://babeljs.io/docs/en/next/babel-helper-module-transforms.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/helper-module-transforms +``` + +or using yarn: + +```sh +yarn add @babel/helper-module-transforms --dev +``` diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/get-module-name.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/get-module-name.js new file mode 100644 index 00000000000000..005469dc1d1738 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/get-module-name.js @@ -0,0 +1,42 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = getModuleName; + +function getModuleName(rootOpts, pluginOpts) { + var _pluginOpts$moduleRoo, _rootOpts$moduleIds, _rootOpts$moduleRoot; + + const { + filename, + filenameRelative = filename, + sourceRoot = (_pluginOpts$moduleRoo = pluginOpts.moduleRoot) != null ? _pluginOpts$moduleRoo : rootOpts.moduleRoot + } = rootOpts; + const { + moduleId = rootOpts.moduleId, + moduleIds = (_rootOpts$moduleIds = rootOpts.moduleIds) != null ? _rootOpts$moduleIds : !!moduleId, + getModuleId = rootOpts.getModuleId, + moduleRoot = (_rootOpts$moduleRoot = rootOpts.moduleRoot) != null ? _rootOpts$moduleRoot : sourceRoot + } = pluginOpts; + if (!moduleIds) return null; + + if (moduleId != null && !getModuleId) { + return moduleId; + } + + let moduleName = moduleRoot != null ? moduleRoot + "/" : ""; + + if (filenameRelative) { + const sourceRootReplacer = sourceRoot != null ? new RegExp("^" + sourceRoot + "/?") : ""; + moduleName += filenameRelative.replace(sourceRootReplacer, "").replace(/\.(\w*?)$/, ""); + } + + moduleName = moduleName.replace(/\\/g, "/"); + + if (getModuleId) { + return getModuleId(moduleName) || moduleName; + } else { + return moduleName; + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/index.js new file mode 100644 index 00000000000000..0ff2249b86bbc6 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/index.js @@ -0,0 +1,358 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.rewriteModuleStatementsAndPrepareHeader = rewriteModuleStatementsAndPrepareHeader; +exports.ensureStatementsHoisted = ensureStatementsHoisted; +exports.wrapInterop = wrapInterop; +exports.buildNamespaceInitStatements = buildNamespaceInitStatements; +Object.defineProperty(exports, "isModule", { + enumerable: true, + get: function () { + return _helperModuleImports.isModule; + } +}); +Object.defineProperty(exports, "rewriteThis", { + enumerable: true, + get: function () { + return _rewriteThis.default; + } +}); +Object.defineProperty(exports, "hasExports", { + enumerable: true, + get: function () { + return _normalizeAndLoadMetadata.hasExports; + } +}); +Object.defineProperty(exports, "isSideEffectImport", { + enumerable: true, + get: function () { + return _normalizeAndLoadMetadata.isSideEffectImport; + } +}); +Object.defineProperty(exports, "getModuleName", { + enumerable: true, + get: function () { + return _getModuleName.default; + } +}); + +var _assert = _interopRequireDefault(require("assert")); + +var t = _interopRequireWildcard(require("@babel/types")); + +var _template = _interopRequireDefault(require("@babel/template")); + +var _chunk = _interopRequireDefault(require("lodash/chunk")); + +var _helperModuleImports = require("@babel/helper-module-imports"); + +var _rewriteThis = _interopRequireDefault(require("./rewrite-this")); + +var _rewriteLiveReferences = _interopRequireDefault(require("./rewrite-live-references")); + +var _normalizeAndLoadMetadata = _interopRequireWildcard(require("./normalize-and-load-metadata")); + +var _getModuleName = _interopRequireDefault(require("./get-module-name")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function rewriteModuleStatementsAndPrepareHeader(path, { + exportName, + strict, + allowTopLevelThis, + strictMode, + loose, + noInterop, + lazy, + esNamespaceOnly +}) { + (0, _assert.default)((0, _helperModuleImports.isModule)(path), "Cannot process module statements in a script"); + path.node.sourceType = "script"; + const meta = (0, _normalizeAndLoadMetadata.default)(path, exportName, { + noInterop, + loose, + lazy, + esNamespaceOnly + }); + + if (!allowTopLevelThis) { + (0, _rewriteThis.default)(path); + } + + (0, _rewriteLiveReferences.default)(path, meta); + + if (strictMode !== false) { + const hasStrict = path.node.directives.some(directive => { + return directive.value.value === "use strict"; + }); + + if (!hasStrict) { + path.unshiftContainer("directives", t.directive(t.directiveLiteral("use strict"))); + } + } + + const headers = []; + + if ((0, _normalizeAndLoadMetadata.hasExports)(meta) && !strict) { + headers.push(buildESModuleHeader(meta, loose)); + } + + const nameList = buildExportNameListDeclaration(path, meta); + + if (nameList) { + meta.exportNameListName = nameList.name; + headers.push(nameList.statement); + } + + headers.push(...buildExportInitializationStatements(path, meta, loose)); + return { + meta, + headers + }; +} + +function ensureStatementsHoisted(statements) { + statements.forEach(header => { + header._blockHoist = 3; + }); +} + +function wrapInterop(programPath, expr, type) { + if (type === "none") { + return null; + } + + let helper; + + if (type === "default") { + helper = "interopRequireDefault"; + } else if (type === "namespace") { + helper = "interopRequireWildcard"; + } else { + throw new Error(`Unknown interop: ${type}`); + } + + return t.callExpression(programPath.hub.addHelper(helper), [expr]); +} + +function buildNamespaceInitStatements(metadata, sourceMetadata, loose = false) { + const statements = []; + let srcNamespace = t.identifier(sourceMetadata.name); + if (sourceMetadata.lazy) srcNamespace = t.callExpression(srcNamespace, []); + + for (const localName of sourceMetadata.importsNamespace) { + if (localName === sourceMetadata.name) continue; + statements.push(_template.default.statement`var NAME = SOURCE;`({ + NAME: localName, + SOURCE: t.cloneNode(srcNamespace) + })); + } + + if (loose) { + statements.push(...buildReexportsFromMeta(metadata, sourceMetadata, loose)); + } + + for (const exportName of sourceMetadata.reexportNamespace) { + statements.push((sourceMetadata.lazy ? _template.default.statement` + Object.defineProperty(EXPORTS, "NAME", { + enumerable: true, + get: function() { + return NAMESPACE; + } + }); + ` : _template.default.statement`EXPORTS.NAME = NAMESPACE;`)({ + EXPORTS: metadata.exportName, + NAME: exportName, + NAMESPACE: t.cloneNode(srcNamespace) + })); + } + + if (sourceMetadata.reexportAll) { + const statement = buildNamespaceReexport(metadata, t.cloneNode(srcNamespace), loose); + statement.loc = sourceMetadata.reexportAll.loc; + statements.push(statement); + } + + return statements; +} + +const ReexportTemplate = { + loose: _template.default.statement`EXPORTS.EXPORT_NAME = NAMESPACE_IMPORT;`, + looseComputed: _template.default.statement`EXPORTS["EXPORT_NAME"] = NAMESPACE_IMPORT;`, + spec: (0, _template.default)` + Object.defineProperty(EXPORTS, "EXPORT_NAME", { + enumerable: true, + get: function() { + return NAMESPACE_IMPORT; + }, + }); + ` +}; + +const buildReexportsFromMeta = (meta, metadata, loose) => { + const namespace = metadata.lazy ? t.callExpression(t.identifier(metadata.name), []) : t.identifier(metadata.name); + const { + stringSpecifiers + } = meta; + return Array.from(metadata.reexports, ([exportName, importName]) => { + let NAMESPACE_IMPORT; + + if (stringSpecifiers.has(importName)) { + NAMESPACE_IMPORT = t.memberExpression(t.cloneNode(namespace), t.stringLiteral(importName), true); + } else { + NAMESPACE_IMPORT = NAMESPACE_IMPORT = t.memberExpression(t.cloneNode(namespace), t.identifier(importName)); + } + + const astNodes = { + EXPORTS: meta.exportName, + EXPORT_NAME: exportName, + NAMESPACE_IMPORT + }; + + if (loose) { + if (stringSpecifiers.has(exportName)) { + return ReexportTemplate.looseComputed(astNodes); + } else { + return ReexportTemplate.loose(astNodes); + } + } else { + return ReexportTemplate.spec(astNodes); + } + }); +}; + +function buildESModuleHeader(metadata, enumerable = false) { + return (enumerable ? _template.default.statement` + EXPORTS.__esModule = true; + ` : _template.default.statement` + Object.defineProperty(EXPORTS, "__esModule", { + value: true, + }); + `)({ + EXPORTS: metadata.exportName + }); +} + +function buildNamespaceReexport(metadata, namespace, loose) { + return (loose ? _template.default.statement` + Object.keys(NAMESPACE).forEach(function(key) { + if (key === "default" || key === "__esModule") return; + VERIFY_NAME_LIST; + if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return; + + EXPORTS[key] = NAMESPACE[key]; + }); + ` : _template.default.statement` + Object.keys(NAMESPACE).forEach(function(key) { + if (key === "default" || key === "__esModule") return; + VERIFY_NAME_LIST; + if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return; + + Object.defineProperty(EXPORTS, key, { + enumerable: true, + get: function() { + return NAMESPACE[key]; + }, + }); + }); + `)({ + NAMESPACE: namespace, + EXPORTS: metadata.exportName, + VERIFY_NAME_LIST: metadata.exportNameListName ? (0, _template.default)` + if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return; + `({ + EXPORTS_LIST: metadata.exportNameListName + }) : null + }); +} + +function buildExportNameListDeclaration(programPath, metadata) { + const exportedVars = Object.create(null); + + for (const data of metadata.local.values()) { + for (const name of data.names) { + exportedVars[name] = true; + } + } + + let hasReexport = false; + + for (const data of metadata.source.values()) { + for (const exportName of data.reexports.keys()) { + exportedVars[exportName] = true; + } + + for (const exportName of data.reexportNamespace) { + exportedVars[exportName] = true; + } + + hasReexport = hasReexport || data.reexportAll; + } + + if (!hasReexport || Object.keys(exportedVars).length === 0) return null; + const name = programPath.scope.generateUidIdentifier("exportNames"); + delete exportedVars.default; + return { + name: name.name, + statement: t.variableDeclaration("var", [t.variableDeclarator(name, t.valueToNode(exportedVars))]) + }; +} + +function buildExportInitializationStatements(programPath, metadata, loose = false) { + const initStatements = []; + const exportNames = []; + + for (const [localName, data] of metadata.local) { + if (data.kind === "import") {} else if (data.kind === "hoisted") { + initStatements.push(buildInitStatement(metadata, data.names, t.identifier(localName))); + } else { + exportNames.push(...data.names); + } + } + + for (const data of metadata.source.values()) { + if (!loose) { + initStatements.push(...buildReexportsFromMeta(metadata, data, loose)); + } + + for (const exportName of data.reexportNamespace) { + exportNames.push(exportName); + } + } + + initStatements.push(...(0, _chunk.default)(exportNames, 100).map(members => { + return buildInitStatement(metadata, members, programPath.scope.buildUndefinedNode()); + })); + return initStatements; +} + +const InitTemplate = { + computed: _template.default.expression`EXPORTS["NAME"] = VALUE`, + default: _template.default.expression`EXPORTS.NAME = VALUE` +}; + +function buildInitStatement(metadata, exportNames, initExpr) { + const { + stringSpecifiers, + exportName: EXPORTS + } = metadata; + return t.expressionStatement(exportNames.reduce((acc, exportName) => { + const params = { + EXPORTS, + NAME: exportName, + VALUE: acc + }; + + if (stringSpecifiers.has(exportName)) { + return InitTemplate.computed(params); + } else { + return InitTemplate.default(params); + } + }, initExpr)); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js new file mode 100644 index 00000000000000..d57c16d121e06e --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js @@ -0,0 +1,368 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hasExports = hasExports; +exports.isSideEffectImport = isSideEffectImport; +exports.default = normalizeModuleAndLoadMetadata; + +var _path = require("path"); + +var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); + +var _helperSplitExportDeclaration = _interopRequireDefault(require("@babel/helper-split-export-declaration")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function hasExports(metadata) { + return metadata.hasExports; +} + +function isSideEffectImport(source) { + return source.imports.size === 0 && source.importsNamespace.size === 0 && source.reexports.size === 0 && source.reexportNamespace.size === 0 && !source.reexportAll; +} + +function normalizeModuleAndLoadMetadata(programPath, exportName, { + noInterop = false, + loose = false, + lazy = false, + esNamespaceOnly = false +} = {}) { + if (!exportName) { + exportName = programPath.scope.generateUidIdentifier("exports").name; + } + + const stringSpecifiers = new Set(); + nameAnonymousExports(programPath); + const { + local, + source, + hasExports + } = getModuleMetadata(programPath, { + loose, + lazy + }, stringSpecifiers); + removeModuleDeclarations(programPath); + + for (const [, metadata] of source) { + if (metadata.importsNamespace.size > 0) { + metadata.name = metadata.importsNamespace.values().next().value; + } + + if (noInterop) metadata.interop = "none";else if (esNamespaceOnly) { + if (metadata.interop === "namespace") { + metadata.interop = "default"; + } + } + } + + return { + exportName, + exportNameListName: null, + hasExports, + local, + source, + stringSpecifiers + }; +} + +function getExportSpecifierName(path, stringSpecifiers) { + if (path.isIdentifier()) { + return path.node.name; + } else if (path.isStringLiteral()) { + const stringValue = path.node.value; + + if (!(0, _helperValidatorIdentifier.isIdentifierName)(stringValue)) { + stringSpecifiers.add(stringValue); + } + + return stringValue; + } else { + throw new Error(`Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`); + } +} + +function getModuleMetadata(programPath, { + loose, + lazy +}, stringSpecifiers) { + const localData = getLocalExportMetadata(programPath, loose, stringSpecifiers); + const sourceData = new Map(); + + const getData = sourceNode => { + const source = sourceNode.value; + let data = sourceData.get(source); + + if (!data) { + data = { + name: programPath.scope.generateUidIdentifier((0, _path.basename)(source, (0, _path.extname)(source))).name, + interop: "none", + loc: null, + imports: new Map(), + importsNamespace: new Set(), + reexports: new Map(), + reexportNamespace: new Set(), + reexportAll: null, + lazy: false + }; + sourceData.set(source, data); + } + + return data; + }; + + let hasExports = false; + programPath.get("body").forEach(child => { + if (child.isImportDeclaration()) { + const data = getData(child.node.source); + if (!data.loc) data.loc = child.node.loc; + child.get("specifiers").forEach(spec => { + if (spec.isImportDefaultSpecifier()) { + const localName = spec.get("local").node.name; + data.imports.set(localName, "default"); + const reexport = localData.get(localName); + + if (reexport) { + localData.delete(localName); + reexport.names.forEach(name => { + data.reexports.set(name, "default"); + }); + } + } else if (spec.isImportNamespaceSpecifier()) { + const localName = spec.get("local").node.name; + data.importsNamespace.add(localName); + const reexport = localData.get(localName); + + if (reexport) { + localData.delete(localName); + reexport.names.forEach(name => { + data.reexportNamespace.add(name); + }); + } + } else if (spec.isImportSpecifier()) { + const importName = getExportSpecifierName(spec.get("imported"), stringSpecifiers); + const localName = spec.get("local").node.name; + data.imports.set(localName, importName); + const reexport = localData.get(localName); + + if (reexport) { + localData.delete(localName); + reexport.names.forEach(name => { + data.reexports.set(name, importName); + }); + } + } + }); + } else if (child.isExportAllDeclaration()) { + hasExports = true; + const data = getData(child.node.source); + if (!data.loc) data.loc = child.node.loc; + data.reexportAll = { + loc: child.node.loc + }; + } else if (child.isExportNamedDeclaration() && child.node.source) { + hasExports = true; + const data = getData(child.node.source); + if (!data.loc) data.loc = child.node.loc; + child.get("specifiers").forEach(spec => { + if (!spec.isExportSpecifier()) { + throw spec.buildCodeFrameError("Unexpected export specifier type"); + } + + const importName = getExportSpecifierName(spec.get("local"), stringSpecifiers); + const exportName = getExportSpecifierName(spec.get("exported"), stringSpecifiers); + data.reexports.set(exportName, importName); + + if (exportName === "__esModule") { + throw exportName.buildCodeFrameError('Illegal export "__esModule".'); + } + }); + } else if (child.isExportNamedDeclaration() || child.isExportDefaultDeclaration()) { + hasExports = true; + } + }); + + for (const metadata of sourceData.values()) { + let needsDefault = false; + let needsNamed = false; + + if (metadata.importsNamespace.size > 0) { + needsDefault = true; + needsNamed = true; + } + + if (metadata.reexportAll) { + needsNamed = true; + } + + for (const importName of metadata.imports.values()) { + if (importName === "default") needsDefault = true;else needsNamed = true; + } + + for (const importName of metadata.reexports.values()) { + if (importName === "default") needsDefault = true;else needsNamed = true; + } + + if (needsDefault && needsNamed) { + metadata.interop = "namespace"; + } else if (needsDefault) { + metadata.interop = "default"; + } + } + + for (const [source, metadata] of sourceData) { + if (lazy !== false && !(isSideEffectImport(metadata) || metadata.reexportAll)) { + if (lazy === true) { + metadata.lazy = !/\./.test(source); + } else if (Array.isArray(lazy)) { + metadata.lazy = lazy.indexOf(source) !== -1; + } else if (typeof lazy === "function") { + metadata.lazy = lazy(source); + } else { + throw new Error(`.lazy must be a boolean, string array, or function`); + } + } + } + + return { + hasExports, + local: localData, + source: sourceData + }; +} + +function getLocalExportMetadata(programPath, loose, stringSpecifiers) { + const bindingKindLookup = new Map(); + programPath.get("body").forEach(child => { + let kind; + + if (child.isImportDeclaration()) { + kind = "import"; + } else { + if (child.isExportDefaultDeclaration()) child = child.get("declaration"); + + if (child.isExportNamedDeclaration()) { + if (child.node.declaration) { + child = child.get("declaration"); + } else if (loose && child.node.source && child.get("source").isStringLiteral()) { + child.node.specifiers.forEach(specifier => { + bindingKindLookup.set(specifier.local.name, "block"); + }); + return; + } + } + + if (child.isFunctionDeclaration()) { + kind = "hoisted"; + } else if (child.isClassDeclaration()) { + kind = "block"; + } else if (child.isVariableDeclaration({ + kind: "var" + })) { + kind = "var"; + } else if (child.isVariableDeclaration()) { + kind = "block"; + } else { + return; + } + } + + Object.keys(child.getOuterBindingIdentifiers()).forEach(name => { + bindingKindLookup.set(name, kind); + }); + }); + const localMetadata = new Map(); + + const getLocalMetadata = idPath => { + const localName = idPath.node.name; + let metadata = localMetadata.get(localName); + + if (!metadata) { + const kind = bindingKindLookup.get(localName); + + if (kind === undefined) { + throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`); + } + + metadata = { + names: [], + kind + }; + localMetadata.set(localName, metadata); + } + + return metadata; + }; + + programPath.get("body").forEach(child => { + if (child.isExportNamedDeclaration() && (loose || !child.node.source)) { + if (child.node.declaration) { + const declaration = child.get("declaration"); + const ids = declaration.getOuterBindingIdentifierPaths(); + Object.keys(ids).forEach(name => { + if (name === "__esModule") { + throw declaration.buildCodeFrameError('Illegal export "__esModule".'); + } + + getLocalMetadata(ids[name]).names.push(name); + }); + } else { + child.get("specifiers").forEach(spec => { + const local = spec.get("local"); + const exported = spec.get("exported"); + const localMetadata = getLocalMetadata(local); + const exportName = getExportSpecifierName(exported, stringSpecifiers); + + if (exportName === "__esModule") { + throw exported.buildCodeFrameError('Illegal export "__esModule".'); + } + + localMetadata.names.push(exportName); + }); + } + } else if (child.isExportDefaultDeclaration()) { + const declaration = child.get("declaration"); + + if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) { + getLocalMetadata(declaration.get("id")).names.push("default"); + } else { + throw declaration.buildCodeFrameError("Unexpected default expression export."); + } + } + }); + return localMetadata; +} + +function nameAnonymousExports(programPath) { + programPath.get("body").forEach(child => { + if (!child.isExportDefaultDeclaration()) return; + (0, _helperSplitExportDeclaration.default)(child); + }); +} + +function removeModuleDeclarations(programPath) { + programPath.get("body").forEach(child => { + if (child.isImportDeclaration()) { + child.remove(); + } else if (child.isExportNamedDeclaration()) { + if (child.node.declaration) { + child.node.declaration._blockHoist = child.node._blockHoist; + child.replaceWith(child.node.declaration); + } else { + child.remove(); + } + } else if (child.isExportDefaultDeclaration()) { + const declaration = child.get("declaration"); + + if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) { + declaration._blockHoist = child.node._blockHoist; + child.replaceWith(declaration); + } else { + throw declaration.buildCodeFrameError("Unexpected default expression export."); + } + } else if (child.isExportAllDeclaration()) { + child.remove(); + } + }); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js new file mode 100644 index 00000000000000..b0ebe01326e350 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js @@ -0,0 +1,297 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rewriteLiveReferences; + +var _assert = _interopRequireDefault(require("assert")); + +var t = _interopRequireWildcard(require("@babel/types")); + +var _template = _interopRequireDefault(require("@babel/template")); + +var _helperSimpleAccess = _interopRequireDefault(require("@babel/helper-simple-access")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function rewriteLiveReferences(programPath, metadata) { + const imported = new Map(); + const exported = new Map(); + + const requeueInParent = path => { + programPath.requeue(path); + }; + + for (const [source, data] of metadata.source) { + for (const [localName, importName] of data.imports) { + imported.set(localName, [source, importName, null]); + } + + for (const localName of data.importsNamespace) { + imported.set(localName, [source, null, localName]); + } + } + + for (const [local, data] of metadata.local) { + let exportMeta = exported.get(local); + + if (!exportMeta) { + exportMeta = []; + exported.set(local, exportMeta); + } + + exportMeta.push(...data.names); + } + + programPath.traverse(rewriteBindingInitVisitor, { + metadata, + requeueInParent, + scope: programPath.scope, + exported + }); + (0, _helperSimpleAccess.default)(programPath, new Set([...Array.from(imported.keys()), ...Array.from(exported.keys())])); + programPath.traverse(rewriteReferencesVisitor, { + seen: new WeakSet(), + metadata, + requeueInParent, + scope: programPath.scope, + imported, + exported, + buildImportReference: ([source, importName, localName], identNode) => { + const meta = metadata.source.get(source); + + if (localName) { + if (meta.lazy) identNode = t.callExpression(identNode, []); + return identNode; + } + + let namespace = t.identifier(meta.name); + if (meta.lazy) namespace = t.callExpression(namespace, []); + const computed = metadata.stringSpecifiers.has(importName); + return t.memberExpression(namespace, computed ? t.stringLiteral(importName) : t.identifier(importName), computed); + } + }); +} + +const rewriteBindingInitVisitor = { + Scope(path) { + path.skip(); + }, + + ClassDeclaration(path) { + const { + requeueInParent, + exported, + metadata + } = this; + const { + id + } = path.node; + if (!id) throw new Error("Expected class to have a name"); + const localName = id.name; + const exportNames = exported.get(localName) || []; + + if (exportNames.length > 0) { + const statement = t.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, t.identifier(localName))); + statement._blockHoist = path.node._blockHoist; + requeueInParent(path.insertAfter(statement)[0]); + } + }, + + VariableDeclaration(path) { + const { + requeueInParent, + exported, + metadata + } = this; + Object.keys(path.getOuterBindingIdentifiers()).forEach(localName => { + const exportNames = exported.get(localName) || []; + + if (exportNames.length > 0) { + const statement = t.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, t.identifier(localName))); + statement._blockHoist = path.node._blockHoist; + requeueInParent(path.insertAfter(statement)[0]); + } + }); + } + +}; + +const buildBindingExportAssignmentExpression = (metadata, exportNames, localExpr) => { + return (exportNames || []).reduce((expr, exportName) => { + const { + stringSpecifiers + } = metadata; + const computed = stringSpecifiers.has(exportName); + return t.assignmentExpression("=", t.memberExpression(t.identifier(metadata.exportName), computed ? t.stringLiteral(exportName) : t.identifier(exportName), computed), expr); + }, localExpr); +}; + +const buildImportThrow = localName => { + return _template.default.expression.ast` + (function() { + throw new Error('"' + '${localName}' + '" is read-only.'); + })() + `; +}; + +const rewriteReferencesVisitor = { + ReferencedIdentifier(path) { + const { + seen, + buildImportReference, + scope, + imported, + requeueInParent + } = this; + if (seen.has(path.node)) return; + seen.add(path.node); + const localName = path.node.name; + const localBinding = path.scope.getBinding(localName); + const rootBinding = scope.getBinding(localName); + if (rootBinding !== localBinding) return; + const importData = imported.get(localName); + + if (importData) { + const ref = buildImportReference(importData, path.node); + ref.loc = path.node.loc; + + if ((path.parentPath.isCallExpression({ + callee: path.node + }) || path.parentPath.isOptionalCallExpression({ + callee: path.node + }) || path.parentPath.isTaggedTemplateExpression({ + tag: path.node + })) && t.isMemberExpression(ref)) { + path.replaceWith(t.sequenceExpression([t.numericLiteral(0), ref])); + } else if (path.isJSXIdentifier() && t.isMemberExpression(ref)) { + const { + object, + property + } = ref; + path.replaceWith(t.JSXMemberExpression(t.JSXIdentifier(object.name), t.JSXIdentifier(property.name))); + } else { + path.replaceWith(ref); + } + + requeueInParent(path); + path.skip(); + } + }, + + AssignmentExpression: { + exit(path) { + const { + scope, + seen, + imported, + exported, + requeueInParent, + buildImportReference + } = this; + if (seen.has(path.node)) return; + seen.add(path.node); + const left = path.get("left"); + if (left.isMemberExpression()) return; + + if (left.isIdentifier()) { + const localName = left.node.name; + + if (scope.getBinding(localName) !== path.scope.getBinding(localName)) { + return; + } + + const exportedNames = exported.get(localName); + const importData = imported.get(localName); + + if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) { + (0, _assert.default)(path.node.operator === "=", "Path was not simplified"); + const assignment = path.node; + + if (importData) { + assignment.left = buildImportReference(importData, assignment.left); + assignment.right = t.sequenceExpression([assignment.right, buildImportThrow(localName)]); + } + + path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, assignment)); + requeueInParent(path); + } + } else { + const ids = left.getOuterBindingIdentifiers(); + const programScopeIds = Object.keys(ids).filter(localName => scope.getBinding(localName) === path.scope.getBinding(localName)); + const id = programScopeIds.find(localName => imported.has(localName)); + + if (id) { + path.node.right = t.sequenceExpression([path.node.right, buildImportThrow(id)]); + } + + const items = []; + programScopeIds.forEach(localName => { + const exportedNames = exported.get(localName) || []; + + if (exportedNames.length > 0) { + items.push(buildBindingExportAssignmentExpression(this.metadata, exportedNames, t.identifier(localName))); + } + }); + + if (items.length > 0) { + let node = t.sequenceExpression(items); + + if (path.parentPath.isExpressionStatement()) { + node = t.expressionStatement(node); + node._blockHoist = path.parentPath.node._blockHoist; + } + + const statement = path.insertAfter(node)[0]; + requeueInParent(statement); + } + } + } + + }, + + "ForOfStatement|ForInStatement"(path) { + const { + scope, + node + } = path; + const { + left + } = node; + const { + exported, + scope: programScope + } = this; + + if (!t.isVariableDeclaration(left)) { + let didTransform = false; + const bodyPath = path.get("body"); + const loopBodyScope = bodyPath.scope; + + for (const name of Object.keys(t.getOuterBindingIdentifiers(left))) { + if (exported.get(name) && programScope.getBinding(name) === scope.getBinding(name)) { + didTransform = true; + + if (loopBodyScope.hasOwnBinding(name)) { + loopBodyScope.rename(name); + } + } + } + + if (!didTransform) { + return; + } + + const newLoopId = scope.generateUidIdentifierBasedOnNode(left); + bodyPath.unshiftContainer("body", t.expressionStatement(t.assignmentExpression("=", left, newLoopId))); + path.get("left").replaceWith(t.variableDeclaration("let", [t.variableDeclarator(t.cloneNode(newLoopId))])); + scope.registerDeclaration(path.get("left")); + } + } + +}; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js new file mode 100644 index 00000000000000..8a7042f4227746 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rewriteThis; + +var _helperReplaceSupers = require("@babel/helper-replace-supers"); + +var _traverse = _interopRequireDefault(require("@babel/traverse")); + +var t = _interopRequireWildcard(require("@babel/types")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function rewriteThis(programPath) { + (0, _traverse.default)(programPath.node, Object.assign({}, rewriteThisVisitor, { + noScope: true + })); +} + +const rewriteThisVisitor = _traverse.default.visitors.merge([_helperReplaceSupers.environmentVisitor, { + ThisExpression(path) { + path.replaceWith(t.unaryExpression("void", t.numericLiteral(0), true)); + } + +}]); \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/package.json b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/package.json new file mode 100644 index 00000000000000..cc356aa1f99183 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-module-transforms/package.json @@ -0,0 +1,28 @@ +{ + "name": "@babel/helper-module-transforms", + "version": "7.12.1", + "description": "Babel helper functions for implementing ES6 module transformations", + "author": "Logan Smyth ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-module-transforms" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-simple-access": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/helper-validator-identifier": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", + "lodash": "^4.17.19" + } +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/LICENSE similarity index 93% rename from tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/LICENSE rename to tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/LICENSE index 620366eb90071c..f31575ec773bb1 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/LICENSE +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2014-2018 Sebastian McKenzie +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 diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/README.md b/tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/README.md new file mode 100644 index 00000000000000..3fdbc9bf187330 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/README.md @@ -0,0 +1,19 @@ +# @babel/helper-optimise-call-expression + +> Helper function to optimise call expression + +See our website [@babel/helper-optimise-call-expression](https://babeljs.io/docs/en/babel-helper-optimise-call-expression) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/helper-optimise-call-expression +``` + +or using yarn: + +```sh +yarn add @babel/helper-optimise-call-expression --dev +``` diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/lib/index.js new file mode 100644 index 00000000000000..0d5b34e5d6fded --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/lib/index.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; + +var t = _interopRequireWildcard(require("@babel/types")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _default(callee, thisNode, args, optional) { + if (args.length === 1 && t.isSpreadElement(args[0]) && t.isIdentifier(args[0].argument, { + name: "arguments" + })) { + if (optional) { + return t.optionalCallExpression(t.optionalMemberExpression(callee, t.identifier("apply"), false, true), [thisNode, args[0].argument], false); + } + + return t.callExpression(t.memberExpression(callee, t.identifier("apply")), [thisNode, args[0].argument]); + } else { + if (optional) { + return t.optionalCallExpression(t.optionalMemberExpression(callee, t.identifier("call"), false, true), [thisNode, ...args], false); + } + + return t.callExpression(t.memberExpression(callee, t.identifier("call")), [thisNode, ...args]); + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/package.json b/tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/package.json new file mode 100644 index 00000000000000..e71c0e887520da --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-optimise-call-expression/package.json @@ -0,0 +1,22 @@ +{ + "name": "@babel/helper-optimise-call-expression", + "version": "7.12.7", + "description": "Helper function to optimise call expression", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-optimise-call-expression" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.12.7" + }, + "devDependencies": { + "@babel/generator": "7.12.5", + "@babel/parser": "7.12.7" + } +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/LICENSE similarity index 93% rename from tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/LICENSE rename to tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/LICENSE index a06ec0e70f286e..f31575ec773bb1 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/LICENSE +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2014-2018 Sebastian McKenzie and other contributors +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 diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/README.md b/tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/README.md new file mode 100644 index 00000000000000..774e0fa49bf4e5 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/README.md @@ -0,0 +1,19 @@ +# @babel/helper-replace-supers + +> Helper function to replace supers + +See our website [@babel/helper-replace-supers](https://babeljs.io/docs/en/babel-helper-replace-supers) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/helper-replace-supers +``` + +or using yarn: + +```sh +yarn add @babel/helper-replace-supers --dev +``` diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/lib/index.js new file mode 100644 index 00000000000000..d434da7028c5ae --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/lib/index.js @@ -0,0 +1,255 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.skipAllButComputedKey = skipAllButComputedKey; +exports.default = exports.environmentVisitor = void 0; + +var _traverse = _interopRequireDefault(require("@babel/traverse")); + +var _helperMemberExpressionToFunctions = _interopRequireDefault(require("@babel/helper-member-expression-to-functions")); + +var _helperOptimiseCallExpression = _interopRequireDefault(require("@babel/helper-optimise-call-expression")); + +var t = _interopRequireWildcard(require("@babel/types")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function getPrototypeOfExpression(objectRef, isStatic, file, isPrivateMethod) { + objectRef = t.cloneNode(objectRef); + const targetRef = isStatic || isPrivateMethod ? objectRef : t.memberExpression(objectRef, t.identifier("prototype")); + return t.callExpression(file.addHelper("getPrototypeOf"), [targetRef]); +} + +function skipAllButComputedKey(path) { + if (!path.node.computed) { + path.skip(); + return; + } + + const keys = t.VISITOR_KEYS[path.type]; + + for (const key of keys) { + if (key !== "key") path.skipKey(key); + } +} + +const environmentVisitor = { + [`${t.StaticBlock ? "StaticBlock|" : ""}ClassPrivateProperty|TypeAnnotation`](path) { + path.skip(); + }, + + Function(path) { + if (path.isMethod()) return; + if (path.isArrowFunctionExpression()) return; + path.skip(); + }, + + "Method|ClassProperty"(path) { + skipAllButComputedKey(path); + } + +}; +exports.environmentVisitor = environmentVisitor; + +const visitor = _traverse.default.visitors.merge([environmentVisitor, { + Super(path, state) { + const { + node, + parentPath + } = path; + if (!parentPath.isMemberExpression({ + object: node + })) return; + state.handle(parentPath); + } + +}]); + +const specHandlers = { + memoise(superMember, count) { + const { + scope, + node + } = superMember; + const { + computed, + property + } = node; + + if (!computed) { + return; + } + + const memo = scope.maybeGenerateMemoised(property); + + if (!memo) { + return; + } + + this.memoiser.set(property, memo, count); + }, + + prop(superMember) { + const { + computed, + property + } = superMember.node; + + if (this.memoiser.has(property)) { + return t.cloneNode(this.memoiser.get(property)); + } + + if (computed) { + return t.cloneNode(property); + } + + return t.stringLiteral(property.name); + }, + + get(superMember) { + return this._get(superMember, this._getThisRefs()); + }, + + _get(superMember, thisRefs) { + const proto = getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod); + return t.callExpression(this.file.addHelper("get"), [thisRefs.memo ? t.sequenceExpression([thisRefs.memo, proto]) : proto, this.prop(superMember), thisRefs.this]); + }, + + _getThisRefs() { + if (!this.isDerivedConstructor) { + return { + this: t.thisExpression() + }; + } + + const thisRef = this.scope.generateDeclaredUidIdentifier("thisSuper"); + return { + memo: t.assignmentExpression("=", thisRef, t.thisExpression()), + this: t.cloneNode(thisRef) + }; + }, + + set(superMember, value) { + const thisRefs = this._getThisRefs(); + + const proto = getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod); + return t.callExpression(this.file.addHelper("set"), [thisRefs.memo ? t.sequenceExpression([thisRefs.memo, proto]) : proto, this.prop(superMember), value, thisRefs.this, t.booleanLiteral(superMember.isInStrictMode())]); + }, + + destructureSet(superMember) { + throw superMember.buildCodeFrameError(`Destructuring to a super field is not supported yet.`); + }, + + call(superMember, args) { + const thisRefs = this._getThisRefs(); + + return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), t.cloneNode(thisRefs.this), args, false); + }, + + optionalCall(superMember, args) { + const thisRefs = this._getThisRefs(); + + return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), t.cloneNode(thisRefs.this), args, true); + } + +}; +const looseHandlers = Object.assign({}, specHandlers, { + prop(superMember) { + const { + property + } = superMember.node; + + if (this.memoiser.has(property)) { + return t.cloneNode(this.memoiser.get(property)); + } + + return t.cloneNode(property); + }, + + get(superMember) { + const { + isStatic, + superRef + } = this; + const { + computed + } = superMember.node; + const prop = this.prop(superMember); + let object; + + if (isStatic) { + object = superRef ? t.cloneNode(superRef) : t.memberExpression(t.identifier("Function"), t.identifier("prototype")); + } else { + object = superRef ? t.memberExpression(t.cloneNode(superRef), t.identifier("prototype")) : t.memberExpression(t.identifier("Object"), t.identifier("prototype")); + } + + return t.memberExpression(object, prop, computed); + }, + + set(superMember, value) { + const { + computed + } = superMember.node; + const prop = this.prop(superMember); + return t.assignmentExpression("=", t.memberExpression(t.thisExpression(), prop, computed), value); + }, + + destructureSet(superMember) { + const { + computed + } = superMember.node; + const prop = this.prop(superMember); + return t.memberExpression(t.thisExpression(), prop, computed); + }, + + call(superMember, args) { + return (0, _helperOptimiseCallExpression.default)(this.get(superMember), t.thisExpression(), args, false); + }, + + optionalCall(superMember, args) { + return (0, _helperOptimiseCallExpression.default)(this.get(superMember), t.thisExpression(), args, true); + } + +}); + +class ReplaceSupers { + constructor(opts) { + const path = opts.methodPath; + this.methodPath = path; + this.isDerivedConstructor = path.isClassMethod({ + kind: "constructor" + }) && !!opts.superRef; + this.isStatic = path.isObjectMethod() || path.node.static; + this.isPrivateMethod = path.isPrivate() && path.isMethod(); + this.file = opts.file; + this.superRef = opts.superRef; + this.isLoose = opts.isLoose; + this.opts = opts; + } + + getObjectRef() { + return t.cloneNode(this.opts.objectRef || this.opts.getObjectRef()); + } + + replace() { + const handler = this.isLoose ? looseHandlers : specHandlers; + (0, _helperMemberExpressionToFunctions.default)(this.methodPath, visitor, Object.assign({ + file: this.file, + scope: this.methodPath.scope, + isDerivedConstructor: this.isDerivedConstructor, + isStatic: this.isStatic, + isPrivateMethod: this.isPrivateMethod, + getObjectRef: this.getObjectRef.bind(this), + superRef: this.superRef + }, handler)); + } + +} + +exports.default = ReplaceSupers; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/package.json b/tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/package.json new file mode 100644 index 00000000000000..e2c2392524fef8 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-replace-supers/package.json @@ -0,0 +1,21 @@ +{ + "name": "@babel/helper-replace-supers", + "version": "7.12.5", + "description": "Helper function to replace supers", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-replace-supers" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.12.1", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/LICENSE new file mode 100644 index 00000000000000..f31575ec773bb1 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/LICENSE @@ -0,0 +1,22 @@ +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/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/README.md b/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/README.md new file mode 100644 index 00000000000000..206436ca8b9f99 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/README.md @@ -0,0 +1,19 @@ +# @babel/helper-simple-access + +> Babel helper for ensuring that access to a given value is performed through simple accesses + +See our website [@babel/helper-simple-access](https://babeljs.io/docs/en/next/babel-helper-simple-access.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/helper-simple-access +``` + +or using yarn: + +```sh +yarn add @babel/helper-simple-access --dev +``` diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/lib/index.js new file mode 100644 index 00000000000000..12cfe7150243c6 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/lib/index.js @@ -0,0 +1,79 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = simplifyAccess; + +var t = _interopRequireWildcard(require("@babel/types")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function simplifyAccess(path, bindingNames) { + path.traverse(simpleAssignmentVisitor, { + scope: path.scope, + bindingNames, + seen: new WeakSet() + }); +} + +const simpleAssignmentVisitor = { + UpdateExpression: { + exit(path) { + const { + scope, + bindingNames + } = this; + const arg = path.get("argument"); + if (!arg.isIdentifier()) return; + const localName = arg.node.name; + if (!bindingNames.has(localName)) return; + + if (scope.getBinding(localName) !== path.scope.getBinding(localName)) { + return; + } + + if (path.parentPath.isExpressionStatement() && !path.isCompletionRecord()) { + const operator = path.node.operator == "++" ? "+=" : "-="; + path.replaceWith(t.assignmentExpression(operator, arg.node, t.numericLiteral(1))); + } else if (path.node.prefix) { + path.replaceWith(t.assignmentExpression("=", t.identifier(localName), t.binaryExpression(path.node.operator[0], t.unaryExpression("+", arg.node), t.numericLiteral(1)))); + } else { + const old = path.scope.generateUidIdentifierBasedOnNode(arg.node, "old"); + const varName = old.name; + path.scope.push({ + id: old + }); + const binary = t.binaryExpression(path.node.operator[0], t.identifier(varName), t.numericLiteral(1)); + path.replaceWith(t.sequenceExpression([t.assignmentExpression("=", t.identifier(varName), t.unaryExpression("+", arg.node)), t.assignmentExpression("=", t.cloneNode(arg.node), binary), t.identifier(varName)])); + } + } + + }, + AssignmentExpression: { + exit(path) { + const { + scope, + seen, + bindingNames + } = this; + if (path.node.operator === "=") return; + if (seen.has(path.node)) return; + seen.add(path.node); + const left = path.get("left"); + if (!left.isIdentifier()) return; + const localName = left.node.name; + if (!bindingNames.has(localName)) return; + + if (scope.getBinding(localName) !== path.scope.getBinding(localName)) { + return; + } + + path.node.right = t.binaryExpression(path.node.operator.slice(0, -1), t.cloneNode(path.node.left), path.node.right); + path.node.operator = "="; + } + + } +}; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/package.json b/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/package.json new file mode 100644 index 00000000000000..a775b777106a5e --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-simple-access/package.json @@ -0,0 +1,20 @@ +{ + "name": "@babel/helper-simple-access", + "version": "7.12.1", + "description": "Babel helper for ensuring that access to a given value is performed through simple accesses", + "author": "Logan Smyth ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-simple-access" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.12.1" + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/LICENSE new file mode 100644 index 00000000000000..f31575ec773bb1 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/LICENSE @@ -0,0 +1,22 @@ +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/tools/node_modules/babel-eslint/node_modules/@babel/helper-split-export-declaration/README.md b/tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/helper-split-export-declaration/README.md rename to tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/README.md diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-split-export-declaration/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/lib/index.js similarity index 55% rename from tools/node_modules/babel-eslint/node_modules/@babel/helper-split-export-declaration/lib/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/lib/index.js index ddb34bc3513867..98e7385572c122 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/helper-split-export-declaration/lib/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/lib/index.js @@ -5,21 +5,15 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = splitExportDeclaration; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function splitExportDeclaration(exportDeclaration) { if (!exportDeclaration.isExportDeclaration()) { - throw new Error("Only export declarations can be splitted."); + throw new Error("Only export declarations can be split."); } const isDefault = exportDeclaration.isExportDefaultDeclaration(); @@ -37,12 +31,12 @@ function splitExportDeclaration(exportDeclaration) { id = scope.generateUidIdentifier("default"); if (standaloneDeclaration || declaration.isFunctionExpression() || declaration.isClassExpression()) { - declaration.node.id = t().cloneNode(id); + declaration.node.id = t.cloneNode(id); } } - const updatedDeclaration = standaloneDeclaration ? declaration : t().variableDeclaration("var", [t().variableDeclarator(t().cloneNode(id), declaration.node)]); - const updatedExportDeclaration = t().exportNamedDeclaration(null, [t().exportSpecifier(t().cloneNode(id), t().identifier("default"))]); + const updatedDeclaration = standaloneDeclaration ? declaration : t.variableDeclaration("var", [t.variableDeclarator(t.cloneNode(id), declaration.node)]); + const updatedExportDeclaration = t.exportNamedDeclaration(null, [t.exportSpecifier(t.cloneNode(id), t.identifier("default"))]); exportDeclaration.insertAfter(updatedExportDeclaration); exportDeclaration.replaceWith(updatedDeclaration); @@ -59,9 +53,9 @@ function splitExportDeclaration(exportDeclaration) { const bindingIdentifiers = declaration.getOuterBindingIdentifiers(); const specifiers = Object.keys(bindingIdentifiers).map(name => { - return t().exportSpecifier(t().identifier(name), t().identifier(name)); + return t.exportSpecifier(t.identifier(name), t.identifier(name)); }); - const aliasDeclar = t().exportNamedDeclaration(null, specifiers); + const aliasDeclar = t.exportNamedDeclaration(null, specifiers); exportDeclaration.insertAfter(aliasDeclar); exportDeclaration.replaceWith(declaration.node); return exportDeclaration; diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/package.json b/tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/package.json new file mode 100644 index 00000000000000..3cd12554e9aa5a --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/package.json @@ -0,0 +1,18 @@ +{ + "name": "@babel/helper-split-export-declaration", + "version": "7.11.0", + "description": "", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-split-export-declaration" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.11.0" + } +} diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/LICENSE new file mode 100644 index 00000000000000..f31575ec773bb1 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/LICENSE @@ -0,0 +1,22 @@ +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/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/README.md b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/README.md new file mode 100644 index 00000000000000..ab2dad173149e8 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/README.md @@ -0,0 +1,19 @@ +# @babel/helper-validator-identifier + +> Validate identifier/keywords name + +See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/next/babel-helper-validator-identifier.html) 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/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/identifier.js new file mode 100644 index 00000000000000..51ec76370ccfc6 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/identifier.js @@ -0,0 +1,77 @@ +"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/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/index.js new file mode 100644 index 00000000000000..7b623c90a6e164 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/index.js @@ -0,0 +1,57 @@ +"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/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/keyword.js new file mode 100644 index 00000000000000..110cee4002896b --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/keyword.js @@ -0,0 +1,38 @@ +"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/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/package.json b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/package.json new file mode 100644 index 00000000000000..79112981bddbb9 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/package.json @@ -0,0 +1,21 @@ +{ + "name": "@babel/helper-validator-identifier", + "version": "7.10.4", + "description": "Validate identifier/keywords name", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-validator-identifier" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "exports": "./lib/index.js", + "devDependencies": { + "charcodes": "^0.2.0", + "unicode-13.0.0": "^0.8.0" + }, + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df" +} diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js new file mode 100644 index 00000000000000..70b371508bdb1b --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js @@ -0,0 +1,75 @@ +"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/tools/node_modules/@babel/core/node_modules/@babel/helpers/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/helpers/LICENSE new file mode 100644 index 00000000000000..f31575ec773bb1 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helpers/LICENSE @@ -0,0 +1,22 @@ +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/tools/node_modules/@babel/core/node_modules/@babel/helpers/README.md b/tools/node_modules/@babel/core/node_modules/@babel/helpers/README.md new file mode 100644 index 00000000000000..3b79dbf5509cf2 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helpers/README.md @@ -0,0 +1,19 @@ +# @babel/helpers + +> Collection of helper functions used by Babel transforms. + +See our website [@babel/helpers](https://babeljs.io/docs/en/babel-helpers) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/helpers +``` + +or using yarn: + +```sh +yarn add @babel/helpers --dev +``` diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helpers/lib/helpers.js b/tools/node_modules/@babel/core/node_modules/@babel/helpers/lib/helpers.js new file mode 100644 index 00000000000000..feb2e016acb608 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helpers/lib/helpers.js @@ -0,0 +1,2078 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _template = _interopRequireDefault(require("@babel/template")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const helpers = Object.create(null); +var _default = helpers; +exports.default = _default; + +const helper = minVersion => tpl => ({ + minVersion, + ast: () => _template.default.program.ast(tpl) +}); + +helpers.typeof = helper("7.0.0-beta.0")` + export default function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function (obj) { return typeof obj; }; + } else { + _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + + return _typeof(obj); + } +`; +helpers.jsx = helper("7.0.0-beta.0")` + var REACT_ELEMENT_TYPE; + + export default function _createRawReactElement(type, props, key, children) { + if (!REACT_ELEMENT_TYPE) { + REACT_ELEMENT_TYPE = ( + typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") + ) || 0xeac7; + } + + var defaultProps = type && type.defaultProps; + var childrenLength = arguments.length - 3; + + if (!props && childrenLength !== 0) { + // If we're going to assign props.children, we create a new object now + // to avoid mutating defaultProps. + props = { + children: void 0, + }; + } + + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = new Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 3]; + } + props.children = childArray; + } + + if (props && defaultProps) { + for (var propName in defaultProps) { + if (props[propName] === void 0) { + props[propName] = defaultProps[propName]; + } + } + } else if (!props) { + props = defaultProps || {}; + } + + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key === undefined ? null : '' + key, + ref: null, + props: props, + _owner: null, + }; + } +`; +helpers.asyncIterator = helper("7.0.0-beta.0")` + export default function _asyncIterator(iterable) { + var method + if (typeof Symbol !== "undefined") { + if (Symbol.asyncIterator) { + method = iterable[Symbol.asyncIterator] + if (method != null) return method.call(iterable); + } + if (Symbol.iterator) { + method = iterable[Symbol.iterator] + if (method != null) return method.call(iterable); + } + } + throw new TypeError("Object is not async iterable"); + } +`; +helpers.AwaitValue = helper("7.0.0-beta.0")` + export default function _AwaitValue(value) { + this.wrapped = value; + } +`; +helpers.AsyncGenerator = helper("7.0.0-beta.0")` + import AwaitValue from "AwaitValue"; + + export default function AsyncGenerator(gen) { + var front, back; + + function send(key, arg) { + return new Promise(function (resolve, reject) { + var request = { + key: key, + arg: arg, + resolve: resolve, + reject: reject, + next: null, + }; + + if (back) { + back = back.next = request; + } else { + front = back = request; + resume(key, arg); + } + }); + } + + function resume(key, arg) { + try { + var result = gen[key](arg) + var value = result.value; + var wrappedAwait = value instanceof AwaitValue; + + Promise.resolve(wrappedAwait ? value.wrapped : value).then( + function (arg) { + if (wrappedAwait) { + resume(key === "return" ? "return" : "next", arg); + return + } + + settle(result.done ? "return" : "normal", arg); + }, + function (err) { resume("throw", err); }); + } catch (err) { + settle("throw", err); + } + } + + function settle(type, value) { + switch (type) { + case "return": + front.resolve({ value: value, done: true }); + break; + case "throw": + front.reject(value); + break; + default: + front.resolve({ value: value, done: false }); + break; + } + + front = front.next; + if (front) { + resume(front.key, front.arg); + } else { + back = null; + } + } + + this._invoke = send; + + // Hide "return" method if generator return is not supported + if (typeof gen.return !== "function") { + this.return = undefined; + } + } + + if (typeof Symbol === "function" && Symbol.asyncIterator) { + AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; }; + } + + AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }; + AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); }; + AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); }; +`; +helpers.wrapAsyncGenerator = helper("7.0.0-beta.0")` + import AsyncGenerator from "AsyncGenerator"; + + export default function _wrapAsyncGenerator(fn) { + return function () { + return new AsyncGenerator(fn.apply(this, arguments)); + }; + } +`; +helpers.awaitAsyncGenerator = helper("7.0.0-beta.0")` + import AwaitValue from "AwaitValue"; + + export default function _awaitAsyncGenerator(value) { + return new AwaitValue(value); + } +`; +helpers.asyncGeneratorDelegate = helper("7.0.0-beta.0")` + export default function _asyncGeneratorDelegate(inner, awaitWrap) { + var iter = {}, waiting = false; + + function pump(key, value) { + waiting = true; + value = new Promise(function (resolve) { resolve(inner[key](value)); }); + return { done: false, value: awaitWrap(value) }; + }; + + if (typeof Symbol === "function" && Symbol.iterator) { + iter[Symbol.iterator] = function () { return this; }; + } + + iter.next = function (value) { + if (waiting) { + waiting = false; + return value; + } + return pump("next", value); + }; + + if (typeof inner.throw === "function") { + iter.throw = function (value) { + if (waiting) { + waiting = false; + throw value; + } + return pump("throw", value); + }; + } + + if (typeof inner.return === "function") { + iter.return = function (value) { + if (waiting) { + waiting = false; + return value; + } + return pump("return", value); + }; + } + + return iter; + } +`; +helpers.asyncToGenerator = helper("7.0.0-beta.0")` + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + + export default function _asyncToGenerator(fn) { + return function () { + var self = this, args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + + _next(undefined); + }); + }; + } +`; +helpers.classCallCheck = helper("7.0.0-beta.0")` + export default function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } +`; +helpers.createClass = helper("7.0.0-beta.0")` + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i ++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + export default function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } +`; +helpers.defineEnumerableProperties = helper("7.0.0-beta.0")` + export default function _defineEnumerableProperties(obj, descs) { + for (var key in descs) { + var desc = descs[key]; + desc.configurable = desc.enumerable = true; + if ("value" in desc) desc.writable = true; + Object.defineProperty(obj, key, desc); + } + + // Symbols are not enumerated over by for-in loops. If native + // Symbols are available, fetch all of the descs object's own + // symbol properties and define them on our target object too. + if (Object.getOwnPropertySymbols) { + var objectSymbols = Object.getOwnPropertySymbols(descs); + for (var i = 0; i < objectSymbols.length; i++) { + var sym = objectSymbols[i]; + var desc = descs[sym]; + desc.configurable = desc.enumerable = true; + if ("value" in desc) desc.writable = true; + Object.defineProperty(obj, sym, desc); + } + } + return obj; + } +`; +helpers.defaults = helper("7.0.0-beta.0")` + export default function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; + } +`; +helpers.defineProperty = helper("7.0.0-beta.0")` + export default function _defineProperty(obj, key, value) { + // Shortcircuit the slow defineProperty path when possible. + // We are trying to avoid issues where setters defined on the + // prototype cause side effects under the fast path of simple + // assignment. By checking for existence of the property with + // the in operator, we can optimize most of this overhead away. + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } +`; +helpers.extends = helper("7.0.0-beta.0")` + export default function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + + return _extends.apply(this, arguments); + } +`; +helpers.objectSpread = helper("7.0.0-beta.0")` + import defineProperty from "defineProperty"; + + export default function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = (arguments[i] != null) ? Object(arguments[i]) : {}; + var ownKeys = Object.keys(source); + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + ownKeys.forEach(function(key) { + defineProperty(target, key, source[key]); + }); + } + return target; + } +`; +helpers.objectSpread2 = helper("7.5.0")` + import defineProperty from "defineProperty"; + + // This function is different to "Reflect.ownKeys". The enumerableOnly + // filters on symbol properties only. Returned string properties are always + // enumerable. It is good to use in objectSpread. + + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + return keys; + } + + export default function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = (arguments[i] != null) ? arguments[i] : {}; + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty( + target, + key, + Object.getOwnPropertyDescriptor(source, key) + ); + }); + } + } + return target; + } +`; +helpers.inherits = helper("7.0.0-beta.0")` + import setPrototypeOf from "setPrototypeOf"; + + export default function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) setPrototypeOf(subClass, superClass); + } +`; +helpers.inheritsLoose = helper("7.0.0-beta.0")` + export default function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; + } +`; +helpers.getPrototypeOf = helper("7.0.0-beta.0")` + export default function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } +`; +helpers.setPrototypeOf = helper("7.0.0-beta.0")` + export default function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } +`; +helpers.isNativeReflectConstruct = helper("7.9.0")` + export default function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + + // core-js@3 + if (Reflect.construct.sham) return false; + + // Proxy can't be polyfilled. Every browser implemented + // proxies before or at the same time as Reflect.construct, + // so if they support Proxy they also support Reflect.construct. + if (typeof Proxy === "function") return true; + + // Since Reflect.construct can't be properly polyfilled, some + // implementations (e.g. core-js@2) don't set the correct internal slots. + // Those polyfills don't allow us to subclass built-ins, so we need to + // use our fallback implementation. + try { + // If the internal slots aren't set, this throws an error similar to + // TypeError: this is not a Date object. + Date.prototype.toString.call(Reflect.construct(Date, [], function() {})); + return true; + } catch (e) { + return false; + } + } +`; +helpers.construct = helper("7.0.0-beta.0")` + import setPrototypeOf from "setPrototypeOf"; + import isNativeReflectConstruct from "isNativeReflectConstruct"; + + export default function _construct(Parent, args, Class) { + if (isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + // NOTE: If Parent !== Class, the correct __proto__ is set *after* + // calling the constructor. + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + // Avoid issues with Class being present but undefined when it wasn't + // present in the original call. + return _construct.apply(null, arguments); + } +`; +helpers.isNativeFunction = helper("7.0.0-beta.0")` + export default function _isNativeFunction(fn) { + // Note: This function returns "true" for core-js functions. + return Function.toString.call(fn).indexOf("[native code]") !== -1; + } +`; +helpers.wrapNativeSuper = helper("7.0.0-beta.0")` + import getPrototypeOf from "getPrototypeOf"; + import setPrototypeOf from "setPrototypeOf"; + import isNativeFunction from "isNativeFunction"; + import construct from "construct"; + + export default function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !isNativeFunction(Class)) return Class; + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + _cache.set(Class, Wrapper); + } + function Wrapper() { + return construct(Class, arguments, getPrototypeOf(this).constructor) + } + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true, + } + }); + + return setPrototypeOf(Wrapper, Class); + } + + return _wrapNativeSuper(Class) + } +`; +helpers.instanceof = helper("7.0.0-beta.0")` + export default function _instanceof(left, right) { + if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { + return !!right[Symbol.hasInstance](left); + } else { + return left instanceof right; + } + } +`; +helpers.interopRequireDefault = helper("7.0.0-beta.0")` + export default function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } +`; +helpers.interopRequireWildcard = helper("7.0.0-beta.0")` + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + + var cache = new WeakMap(); + _getRequireWildcardCache = function () { return cache; }; + return cache; + } + + export default function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + + if (obj === null || (typeof obj !== "object" && typeof obj !== "function")) { + return { default: obj } + } + + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } +`; +helpers.newArrowCheck = helper("7.0.0-beta.0")` + export default function _newArrowCheck(innerThis, boundThis) { + if (innerThis !== boundThis) { + throw new TypeError("Cannot instantiate an arrow function"); + } + } +`; +helpers.objectDestructuringEmpty = helper("7.0.0-beta.0")` + export default function _objectDestructuringEmpty(obj) { + if (obj == null) throw new TypeError("Cannot destructure undefined"); + } +`; +helpers.objectWithoutPropertiesLoose = helper("7.0.0-beta.0")` + export default function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; + } +`; +helpers.objectWithoutProperties = helper("7.0.0-beta.0")` + import objectWithoutPropertiesLoose from "objectWithoutPropertiesLoose"; + + export default function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + + var target = objectWithoutPropertiesLoose(source, excluded); + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + + return target; + } +`; +helpers.assertThisInitialized = helper("7.0.0-beta.0")` + export default function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self; + } +`; +helpers.possibleConstructorReturn = helper("7.0.0-beta.0")` + import assertThisInitialized from "assertThisInitialized"; + + export default function _possibleConstructorReturn(self, call) { + if (call && (typeof call === "object" || typeof call === "function")) { + return call; + } + return assertThisInitialized(self); + } +`; +helpers.createSuper = helper("7.9.0")` + import getPrototypeOf from "getPrototypeOf"; + import isNativeReflectConstruct from "isNativeReflectConstruct"; + import possibleConstructorReturn from "possibleConstructorReturn"; + + export default function _createSuper(Derived) { + var hasNativeReflectConstruct = isNativeReflectConstruct(); + + return function _createSuperInternal() { + var Super = getPrototypeOf(Derived), result; + if (hasNativeReflectConstruct) { + // NOTE: This doesn't work if this.__proto__.constructor has been modified. + var NewTarget = getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return possibleConstructorReturn(this, result); + } + } + `; +helpers.superPropBase = helper("7.0.0-beta.0")` + import getPrototypeOf from "getPrototypeOf"; + + export default function _superPropBase(object, property) { + // Yes, this throws if object is null to being with, that's on purpose. + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = getPrototypeOf(object); + if (object === null) break; + } + return object; + } +`; +helpers.get = helper("7.0.0-beta.0")` + import superPropBase from "superPropBase"; + + export default function _get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + _get = Reflect.get; + } else { + _get = function _get(target, property, receiver) { + var base = superPropBase(target, property); + + if (!base) return; + + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + + return desc.value; + }; + } + return _get(target, property, receiver || target); + } +`; +helpers.set = helper("7.0.0-beta.0")` + import superPropBase from "superPropBase"; + import defineProperty from "defineProperty"; + + function set(target, property, value, receiver) { + if (typeof Reflect !== "undefined" && Reflect.set) { + set = Reflect.set; + } else { + set = function set(target, property, value, receiver) { + var base = superPropBase(target, property); + var desc; + + if (base) { + desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.set) { + desc.set.call(receiver, value); + return true; + } else if (!desc.writable) { + // Both getter and non-writable fall into this. + return false; + } + } + + // Without a super that defines the property, spec boils down to + // "define on receiver" for some reason. + desc = Object.getOwnPropertyDescriptor(receiver, property); + if (desc) { + if (!desc.writable) { + // Setter, getter, and non-writable fall into this. + return false; + } + + desc.value = value; + Object.defineProperty(receiver, property, desc); + } else { + // Avoid setters that may be defined on Sub's prototype, but not on + // the instance. + defineProperty(receiver, property, value); + } + + return true; + }; + } + + return set(target, property, value, receiver); + } + + export default function _set(target, property, value, receiver, isStrict) { + var s = set(target, property, value, receiver || target); + if (!s && isStrict) { + throw new Error('failed to set property'); + } + + return value; + } +`; +helpers.taggedTemplateLiteral = helper("7.0.0-beta.0")` + export default function _taggedTemplateLiteral(strings, raw) { + if (!raw) { raw = strings.slice(0); } + return Object.freeze(Object.defineProperties(strings, { + raw: { value: Object.freeze(raw) } + })); + } +`; +helpers.taggedTemplateLiteralLoose = helper("7.0.0-beta.0")` + export default function _taggedTemplateLiteralLoose(strings, raw) { + if (!raw) { raw = strings.slice(0); } + strings.raw = raw; + return strings; + } +`; +helpers.readOnlyError = helper("7.0.0-beta.0")` + export default function _readOnlyError(name) { + throw new TypeError("\\"" + name + "\\" is read-only"); + } +`; +helpers.classNameTDZError = helper("7.0.0-beta.0")` + export default function _classNameTDZError(name) { + throw new Error("Class \\"" + name + "\\" cannot be referenced in computed property keys."); + } +`; +helpers.temporalUndefined = helper("7.0.0-beta.0")` + // This function isn't mean to be called, but to be used as a reference. + // We can't use a normal object because it isn't hoisted. + export default function _temporalUndefined() {} +`; +helpers.tdz = helper("7.5.5")` + export default function _tdzError(name) { + throw new ReferenceError(name + " is not defined - temporal dead zone"); + } +`; +helpers.temporalRef = helper("7.0.0-beta.0")` + import undef from "temporalUndefined"; + import err from "tdz"; + + export default function _temporalRef(val, name) { + return val === undef ? err(name) : val; + } +`; +helpers.slicedToArray = helper("7.0.0-beta.0")` + import arrayWithHoles from "arrayWithHoles"; + import iterableToArrayLimit from "iterableToArrayLimit"; + import unsupportedIterableToArray from "unsupportedIterableToArray"; + import nonIterableRest from "nonIterableRest"; + + export default function _slicedToArray(arr, i) { + return ( + arrayWithHoles(arr) || + iterableToArrayLimit(arr, i) || + unsupportedIterableToArray(arr, i) || + nonIterableRest() + ); + } +`; +helpers.slicedToArrayLoose = helper("7.0.0-beta.0")` + import arrayWithHoles from "arrayWithHoles"; + import iterableToArrayLimitLoose from "iterableToArrayLimitLoose"; + import unsupportedIterableToArray from "unsupportedIterableToArray"; + import nonIterableRest from "nonIterableRest"; + + export default function _slicedToArrayLoose(arr, i) { + return ( + arrayWithHoles(arr) || + iterableToArrayLimitLoose(arr, i) || + unsupportedIterableToArray(arr, i) || + nonIterableRest() + ); + } +`; +helpers.toArray = helper("7.0.0-beta.0")` + import arrayWithHoles from "arrayWithHoles"; + import iterableToArray from "iterableToArray"; + import unsupportedIterableToArray from "unsupportedIterableToArray"; + import nonIterableRest from "nonIterableRest"; + + export default function _toArray(arr) { + return ( + arrayWithHoles(arr) || + iterableToArray(arr) || + unsupportedIterableToArray(arr) || + nonIterableRest() + ); + } +`; +helpers.toConsumableArray = helper("7.0.0-beta.0")` + import arrayWithoutHoles from "arrayWithoutHoles"; + import iterableToArray from "iterableToArray"; + import unsupportedIterableToArray from "unsupportedIterableToArray"; + import nonIterableSpread from "nonIterableSpread"; + + export default function _toConsumableArray(arr) { + return ( + arrayWithoutHoles(arr) || + iterableToArray(arr) || + unsupportedIterableToArray(arr) || + nonIterableSpread() + ); + } +`; +helpers.arrayWithoutHoles = helper("7.0.0-beta.0")` + import arrayLikeToArray from "arrayLikeToArray"; + + export default function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return arrayLikeToArray(arr); + } +`; +helpers.arrayWithHoles = helper("7.0.0-beta.0")` + export default function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } +`; +helpers.maybeArrayLike = helper("7.9.0")` + import arrayLikeToArray from "arrayLikeToArray"; + + export default function _maybeArrayLike(next, arr, i) { + if (arr && !Array.isArray(arr) && typeof arr.length === "number") { + var len = arr.length; + return arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); + } + return next(arr, i); + } +`; +helpers.iterableToArray = helper("7.0.0-beta.0")` + export default function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } +`; +helpers.iterableToArrayLimit = helper("7.0.0-beta.0")` + export default function _iterableToArrayLimit(arr, i) { + // this is an expanded form of \`for...of\` that properly supports abrupt completions of + // iterators etc. variable names have been minimised to reduce the size of this massive + // helper. sometimes spec compliance is annoying :( + // + // _n = _iteratorNormalCompletion + // _d = _didIteratorError + // _e = _iteratorError + // _i = _iterator + // _s = _step + + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } +`; +helpers.iterableToArrayLimitLoose = helper("7.0.0-beta.0")` + export default function _iterableToArrayLimitLoose(arr, i) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + + var _arr = []; + for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { + _arr.push(_step.value); + if (i && _arr.length === i) break; + } + return _arr; + } +`; +helpers.unsupportedIterableToArray = helper("7.9.0")` + import arrayLikeToArray from "arrayLikeToArray"; + + export default function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return arrayLikeToArray(o, minLen); + } +`; +helpers.arrayLikeToArray = helper("7.9.0")` + export default function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } +`; +helpers.nonIterableSpread = helper("7.0.0-beta.0")` + export default function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." + ); + } +`; +helpers.nonIterableRest = helper("7.0.0-beta.0")` + export default function _nonIterableRest() { + throw new TypeError( + "Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." + ); + } +`; +helpers.createForOfIteratorHelper = helper("7.9.0")` + import unsupportedIterableToArray from "unsupportedIterableToArray"; + + // s: start (create the iterator) + // n: next + // e: error (called whenever something throws) + // f: finish (always called at the end) + + export default function _createForOfIteratorHelper(o, allowArrayLike) { + var it; + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + // Fallback for engines without symbol support + if ( + Array.isArray(o) || + (it = unsupportedIterableToArray(o)) || + (allowArrayLike && o && typeof o.length === "number") + ) { + if (it) o = it; + var i = 0; + var F = function(){}; + return { + s: F, + n: function() { + if (i >= o.length) return { done: true }; + return { done: false, value: o[i++] }; + }, + e: function(e) { throw e; }, + f: F, + }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var normalCompletion = true, didErr = false, err; + + return { + s: function() { + it = o[Symbol.iterator](); + }, + n: function() { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function(e) { + didErr = true; + err = e; + }, + f: function() { + try { + if (!normalCompletion && it.return != null) it.return(); + } finally { + if (didErr) throw err; + } + } + }; + } +`; +helpers.createForOfIteratorHelperLoose = helper("7.9.0")` + import unsupportedIterableToArray from "unsupportedIterableToArray"; + + export default function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it; + + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + // Fallback for engines without symbol support + if ( + Array.isArray(o) || + (it = unsupportedIterableToArray(o)) || + (allowArrayLike && o && typeof o.length === "number") + ) { + if (it) o = it; + var i = 0; + return function() { + if (i >= o.length) return { done: true }; + return { done: false, value: o[i++] }; + } + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + it = o[Symbol.iterator](); + return it.next.bind(it); + } +`; +helpers.skipFirstGeneratorNext = helper("7.0.0-beta.0")` + export default function _skipFirstGeneratorNext(fn) { + return function () { + var it = fn.apply(this, arguments); + it.next(); + return it; + } + } +`; +helpers.toPrimitive = helper("7.1.5")` + export default function _toPrimitive( + input, + hint /*: "default" | "string" | "number" | void */ + ) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } +`; +helpers.toPropertyKey = helper("7.1.5")` + import toPrimitive from "toPrimitive"; + + export default function _toPropertyKey(arg) { + var key = toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } +`; +helpers.initializerWarningHelper = helper("7.0.0-beta.0")` + export default function _initializerWarningHelper(descriptor, context){ + throw new Error( + 'Decorating class property failed. Please ensure that ' + + 'proposal-class-properties is enabled and runs after the decorators transform.' + ); + } +`; +helpers.initializerDefineProperty = helper("7.0.0-beta.0")` + export default function _initializerDefineProperty(target, property, descriptor, context){ + if (!descriptor) return; + + Object.defineProperty(target, property, { + enumerable: descriptor.enumerable, + configurable: descriptor.configurable, + writable: descriptor.writable, + value: descriptor.initializer ? descriptor.initializer.call(context) : void 0, + }); + } +`; +helpers.applyDecoratedDescriptor = helper("7.0.0-beta.0")` + export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context){ + var desc = {}; + Object.keys(descriptor).forEach(function(key){ + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + if ('value' in desc || desc.initializer){ + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function(desc, decorator){ + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0){ + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0){ + Object.defineProperty(target, property, desc); + desc = null; + } + + return desc; + } +`; +helpers.classPrivateFieldLooseKey = helper("7.0.0-beta.0")` + var id = 0; + export default function _classPrivateFieldKey(name) { + return "__private_" + (id++) + "_" + name; + } +`; +helpers.classPrivateFieldLooseBase = helper("7.0.0-beta.0")` + export default function _classPrivateFieldBase(receiver, privateKey) { + if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { + throw new TypeError("attempted to use private field on non-instance"); + } + return receiver; + } +`; +helpers.classPrivateFieldGet = helper("7.0.0-beta.0")` + export default function _classPrivateFieldGet(receiver, privateMap) { + var descriptor = privateMap.get(receiver); + if (!descriptor) { + throw new TypeError("attempted to get private field on non-instance"); + } + if (descriptor.get) { + return descriptor.get.call(receiver); + } + return descriptor.value; + } +`; +helpers.classPrivateFieldSet = helper("7.0.0-beta.0")` + export default function _classPrivateFieldSet(receiver, privateMap, value) { + var descriptor = privateMap.get(receiver); + if (!descriptor) { + throw new TypeError("attempted to set private field on non-instance"); + } + if (descriptor.set) { + descriptor.set.call(receiver, value); + } else { + if (!descriptor.writable) { + // This should only throw in strict mode, but class bodies are + // always strict and private fields can only be used inside + // class bodies. + throw new TypeError("attempted to set read only private field"); + } + + descriptor.value = value; + } + + return value; + } +`; +helpers.classPrivateFieldDestructureSet = helper("7.4.4")` + export default function _classPrivateFieldDestructureSet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + var descriptor = privateMap.get(receiver); + if (descriptor.set) { + if (!("__destrObj" in descriptor)) { + descriptor.__destrObj = { + set value(v) { + descriptor.set.call(receiver, v) + }, + }; + } + return descriptor.__destrObj; + } else { + if (!descriptor.writable) { + // This should only throw in strict mode, but class bodies are + // always strict and private fields can only be used inside + // class bodies. + throw new TypeError("attempted to set read only private field"); + } + + return descriptor; + } + } +`; +helpers.classStaticPrivateFieldSpecGet = helper("7.0.2")` + export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { + if (receiver !== classConstructor) { + throw new TypeError("Private static access of wrong provenance"); + } + if (descriptor.get) { + return descriptor.get.call(receiver); + } + return descriptor.value; + } +`; +helpers.classStaticPrivateFieldSpecSet = helper("7.0.2")` + export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { + if (receiver !== classConstructor) { + throw new TypeError("Private static access of wrong provenance"); + } + if (descriptor.set) { + descriptor.set.call(receiver, value); + } else { + if (!descriptor.writable) { + // This should only throw in strict mode, but class bodies are + // always strict and private fields can only be used inside + // class bodies. + throw new TypeError("attempted to set read only private field"); + } + descriptor.value = value; + } + + return value; + } +`; +helpers.classStaticPrivateMethodGet = helper("7.3.2")` + export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) { + if (receiver !== classConstructor) { + throw new TypeError("Private static access of wrong provenance"); + } + return method; + } +`; +helpers.classStaticPrivateMethodSet = helper("7.3.2")` + export default function _classStaticPrivateMethodSet() { + throw new TypeError("attempted to set read only static private field"); + } +`; +helpers.decorate = helper("7.1.5")` + import toArray from "toArray"; + import toPropertyKey from "toPropertyKey"; + + // These comments are stripped by @babel/template + /*:: + type PropertyDescriptor = + | { + value: any, + writable: boolean, + configurable: boolean, + enumerable: boolean, + } + | { + get?: () => any, + set?: (v: any) => void, + configurable: boolean, + enumerable: boolean, + }; + + type FieldDescriptor ={ + writable: boolean, + configurable: boolean, + enumerable: boolean, + }; + + type Placement = "static" | "prototype" | "own"; + type Key = string | symbol; // PrivateName is not supported yet. + + type ElementDescriptor = + | { + kind: "method", + key: Key, + placement: Placement, + descriptor: PropertyDescriptor + } + | { + kind: "field", + key: Key, + placement: Placement, + descriptor: FieldDescriptor, + initializer?: () => any, + }; + + // This is exposed to the user code + type ElementObjectInput = ElementDescriptor & { + [@@toStringTag]?: "Descriptor" + }; + + // This is exposed to the user code + type ElementObjectOutput = ElementDescriptor & { + [@@toStringTag]?: "Descriptor" + extras?: ElementDescriptor[], + finisher?: ClassFinisher, + }; + + // This is exposed to the user code + type ClassObject = { + [@@toStringTag]?: "Descriptor", + kind: "class", + elements: ElementDescriptor[], + }; + + type ElementDecorator = (descriptor: ElementObjectInput) => ?ElementObjectOutput; + type ClassDecorator = (descriptor: ClassObject) => ?ClassObject; + type ClassFinisher = (cl: Class) => Class; + + // Only used by Babel in the transform output, not part of the spec. + type ElementDefinition = + | { + kind: "method", + value: any, + key: Key, + static?: boolean, + decorators?: ElementDecorator[], + } + | { + kind: "field", + value: () => any, + key: Key, + static?: boolean, + decorators?: ElementDecorator[], + }; + + declare function ClassFactory(initialize: (instance: C) => void): { + F: Class, + d: ElementDefinition[] + } + + */ + + /*:: + // Various combinations with/without extras and with one or many finishers + + type ElementFinisherExtras = { + element: ElementDescriptor, + finisher?: ClassFinisher, + extras?: ElementDescriptor[], + }; + + type ElementFinishersExtras = { + element: ElementDescriptor, + finishers: ClassFinisher[], + extras: ElementDescriptor[], + }; + + type ElementsFinisher = { + elements: ElementDescriptor[], + finisher?: ClassFinisher, + }; + + type ElementsFinishers = { + elements: ElementDescriptor[], + finishers: ClassFinisher[], + }; + + */ + + /*:: + + type Placements = { + static: Key[], + prototype: Key[], + own: Key[], + }; + + */ + + // ClassDefinitionEvaluation (Steps 26-*) + export default function _decorate( + decorators /*: ClassDecorator[] */, + factory /*: ClassFactory */, + superClass /*: ?Class<*> */, + mixins /*: ?Array */, + ) /*: Class<*> */ { + var api = _getDecoratorsApi(); + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + api = mixins[i](api); + } + } + + var r = factory(function initialize(O) { + api.initializeInstanceElements(O, decorated.elements); + }, superClass); + var decorated = api.decorateClass( + _coalesceClassElements(r.d.map(_createElementDescriptor)), + decorators, + ); + + api.initializeClassElements(r.F, decorated.elements); + + return api.runClassFinishers(r.F, decorated.finishers); + } + + function _getDecoratorsApi() { + _getDecoratorsApi = function() { + return api; + }; + + var api = { + elementsDefinitionOrder: [["method"], ["field"]], + + // InitializeInstanceElements + initializeInstanceElements: function( + /*::*/ O /*: C */, + elements /*: ElementDescriptor[] */, + ) { + ["method", "field"].forEach(function(kind) { + elements.forEach(function(element /*: ElementDescriptor */) { + if (element.kind === kind && element.placement === "own") { + this.defineClassElement(O, element); + } + }, this); + }, this); + }, + + // InitializeClassElements + initializeClassElements: function( + /*::*/ F /*: Class */, + elements /*: ElementDescriptor[] */, + ) { + var proto = F.prototype; + + ["method", "field"].forEach(function(kind) { + elements.forEach(function(element /*: ElementDescriptor */) { + var placement = element.placement; + if ( + element.kind === kind && + (placement === "static" || placement === "prototype") + ) { + var receiver = placement === "static" ? F : proto; + this.defineClassElement(receiver, element); + } + }, this); + }, this); + }, + + // DefineClassElement + defineClassElement: function( + /*::*/ receiver /*: C | Class */, + element /*: ElementDescriptor */, + ) { + var descriptor /*: PropertyDescriptor */ = element.descriptor; + if (element.kind === "field") { + var initializer = element.initializer; + descriptor = { + enumerable: descriptor.enumerable, + writable: descriptor.writable, + configurable: descriptor.configurable, + value: initializer === void 0 ? void 0 : initializer.call(receiver), + }; + } + Object.defineProperty(receiver, element.key, descriptor); + }, + + // DecorateClass + decorateClass: function( + elements /*: ElementDescriptor[] */, + decorators /*: ClassDecorator[] */, + ) /*: ElementsFinishers */ { + var newElements /*: ElementDescriptor[] */ = []; + var finishers /*: ClassFinisher[] */ = []; + var placements /*: Placements */ = { + static: [], + prototype: [], + own: [], + }; + + elements.forEach(function(element /*: ElementDescriptor */) { + this.addElementPlacement(element, placements); + }, this); + + elements.forEach(function(element /*: ElementDescriptor */) { + if (!_hasDecorators(element)) return newElements.push(element); + + var elementFinishersExtras /*: ElementFinishersExtras */ = this.decorateElement( + element, + placements, + ); + newElements.push(elementFinishersExtras.element); + newElements.push.apply(newElements, elementFinishersExtras.extras); + finishers.push.apply(finishers, elementFinishersExtras.finishers); + }, this); + + if (!decorators) { + return { elements: newElements, finishers: finishers }; + } + + var result /*: ElementsFinishers */ = this.decorateConstructor( + newElements, + decorators, + ); + finishers.push.apply(finishers, result.finishers); + result.finishers = finishers; + + return result; + }, + + // AddElementPlacement + addElementPlacement: function( + element /*: ElementDescriptor */, + placements /*: Placements */, + silent /*: boolean */, + ) { + var keys = placements[element.placement]; + if (!silent && keys.indexOf(element.key) !== -1) { + throw new TypeError("Duplicated element (" + element.key + ")"); + } + keys.push(element.key); + }, + + // DecorateElement + decorateElement: function( + element /*: ElementDescriptor */, + placements /*: Placements */, + ) /*: ElementFinishersExtras */ { + var extras /*: ElementDescriptor[] */ = []; + var finishers /*: ClassFinisher[] */ = []; + + for ( + var decorators = element.decorators, i = decorators.length - 1; + i >= 0; + i-- + ) { + // (inlined) RemoveElementPlacement + var keys = placements[element.placement]; + keys.splice(keys.indexOf(element.key), 1); + + var elementObject /*: ElementObjectInput */ = this.fromElementDescriptor( + element, + ); + var elementFinisherExtras /*: ElementFinisherExtras */ = this.toElementFinisherExtras( + (0, decorators[i])(elementObject) /*: ElementObjectOutput */ || + elementObject, + ); + + element = elementFinisherExtras.element; + this.addElementPlacement(element, placements); + + if (elementFinisherExtras.finisher) { + finishers.push(elementFinisherExtras.finisher); + } + + var newExtras /*: ElementDescriptor[] | void */ = + elementFinisherExtras.extras; + if (newExtras) { + for (var j = 0; j < newExtras.length; j++) { + this.addElementPlacement(newExtras[j], placements); + } + extras.push.apply(extras, newExtras); + } + } + + return { element: element, finishers: finishers, extras: extras }; + }, + + // DecorateConstructor + decorateConstructor: function( + elements /*: ElementDescriptor[] */, + decorators /*: ClassDecorator[] */, + ) /*: ElementsFinishers */ { + var finishers /*: ClassFinisher[] */ = []; + + for (var i = decorators.length - 1; i >= 0; i--) { + var obj /*: ClassObject */ = this.fromClassDescriptor(elements); + var elementsAndFinisher /*: ElementsFinisher */ = this.toClassDescriptor( + (0, decorators[i])(obj) /*: ClassObject */ || obj, + ); + + if (elementsAndFinisher.finisher !== undefined) { + finishers.push(elementsAndFinisher.finisher); + } + + if (elementsAndFinisher.elements !== undefined) { + elements = elementsAndFinisher.elements; + + for (var j = 0; j < elements.length - 1; j++) { + for (var k = j + 1; k < elements.length; k++) { + if ( + elements[j].key === elements[k].key && + elements[j].placement === elements[k].placement + ) { + throw new TypeError( + "Duplicated element (" + elements[j].key + ")", + ); + } + } + } + } + } + + return { elements: elements, finishers: finishers }; + }, + + // FromElementDescriptor + fromElementDescriptor: function( + element /*: ElementDescriptor */, + ) /*: ElementObject */ { + var obj /*: ElementObject */ = { + kind: element.kind, + key: element.key, + placement: element.placement, + descriptor: element.descriptor, + }; + + var desc = { + value: "Descriptor", + configurable: true, + }; + Object.defineProperty(obj, Symbol.toStringTag, desc); + + if (element.kind === "field") obj.initializer = element.initializer; + + return obj; + }, + + // ToElementDescriptors + toElementDescriptors: function( + elementObjects /*: ElementObject[] */, + ) /*: ElementDescriptor[] */ { + if (elementObjects === undefined) return; + return toArray(elementObjects).map(function(elementObject) { + var element = this.toElementDescriptor(elementObject); + this.disallowProperty(elementObject, "finisher", "An element descriptor"); + this.disallowProperty(elementObject, "extras", "An element descriptor"); + return element; + }, this); + }, + + // ToElementDescriptor + toElementDescriptor: function( + elementObject /*: ElementObject */, + ) /*: ElementDescriptor */ { + var kind = String(elementObject.kind); + if (kind !== "method" && kind !== "field") { + throw new TypeError( + 'An element descriptor\\'s .kind property must be either "method" or' + + ' "field", but a decorator created an element descriptor with' + + ' .kind "' + + kind + + '"', + ); + } + + var key = toPropertyKey(elementObject.key); + + var placement = String(elementObject.placement); + if ( + placement !== "static" && + placement !== "prototype" && + placement !== "own" + ) { + throw new TypeError( + 'An element descriptor\\'s .placement property must be one of "static",' + + ' "prototype" or "own", but a decorator created an element descriptor' + + ' with .placement "' + + placement + + '"', + ); + } + + var descriptor /*: PropertyDescriptor */ = elementObject.descriptor; + + this.disallowProperty(elementObject, "elements", "An element descriptor"); + + var element /*: ElementDescriptor */ = { + kind: kind, + key: key, + placement: placement, + descriptor: Object.assign({}, descriptor), + }; + + if (kind !== "field") { + this.disallowProperty(elementObject, "initializer", "A method descriptor"); + } else { + this.disallowProperty( + descriptor, + "get", + "The property descriptor of a field descriptor", + ); + this.disallowProperty( + descriptor, + "set", + "The property descriptor of a field descriptor", + ); + this.disallowProperty( + descriptor, + "value", + "The property descriptor of a field descriptor", + ); + + element.initializer = elementObject.initializer; + } + + return element; + }, + + toElementFinisherExtras: function( + elementObject /*: ElementObject */, + ) /*: ElementFinisherExtras */ { + var element /*: ElementDescriptor */ = this.toElementDescriptor( + elementObject, + ); + var finisher /*: ClassFinisher */ = _optionalCallableProperty( + elementObject, + "finisher", + ); + var extras /*: ElementDescriptors[] */ = this.toElementDescriptors( + elementObject.extras, + ); + + return { element: element, finisher: finisher, extras: extras }; + }, + + // FromClassDescriptor + fromClassDescriptor: function( + elements /*: ElementDescriptor[] */, + ) /*: ClassObject */ { + var obj = { + kind: "class", + elements: elements.map(this.fromElementDescriptor, this), + }; + + var desc = { value: "Descriptor", configurable: true }; + Object.defineProperty(obj, Symbol.toStringTag, desc); + + return obj; + }, + + // ToClassDescriptor + toClassDescriptor: function( + obj /*: ClassObject */, + ) /*: ElementsFinisher */ { + var kind = String(obj.kind); + if (kind !== "class") { + throw new TypeError( + 'A class descriptor\\'s .kind property must be "class", but a decorator' + + ' created a class descriptor with .kind "' + + kind + + '"', + ); + } + + this.disallowProperty(obj, "key", "A class descriptor"); + this.disallowProperty(obj, "placement", "A class descriptor"); + this.disallowProperty(obj, "descriptor", "A class descriptor"); + this.disallowProperty(obj, "initializer", "A class descriptor"); + this.disallowProperty(obj, "extras", "A class descriptor"); + + var finisher = _optionalCallableProperty(obj, "finisher"); + var elements = this.toElementDescriptors(obj.elements); + + return { elements: elements, finisher: finisher }; + }, + + // RunClassFinishers + runClassFinishers: function( + constructor /*: Class<*> */, + finishers /*: ClassFinisher[] */, + ) /*: Class<*> */ { + for (var i = 0; i < finishers.length; i++) { + var newConstructor /*: ?Class<*> */ = (0, finishers[i])(constructor); + if (newConstructor !== undefined) { + // NOTE: This should check if IsConstructor(newConstructor) is false. + if (typeof newConstructor !== "function") { + throw new TypeError("Finishers must return a constructor."); + } + constructor = newConstructor; + } + } + return constructor; + }, + + disallowProperty: function(obj, name, objectType) { + if (obj[name] !== undefined) { + throw new TypeError(objectType + " can't have a ." + name + " property."); + } + } + }; + + return api; + } + + // ClassElementEvaluation + function _createElementDescriptor( + def /*: ElementDefinition */, + ) /*: ElementDescriptor */ { + var key = toPropertyKey(def.key); + + var descriptor /*: PropertyDescriptor */; + if (def.kind === "method") { + descriptor = { + value: def.value, + writable: true, + configurable: true, + enumerable: false, + }; + } else if (def.kind === "get") { + descriptor = { get: def.value, configurable: true, enumerable: false }; + } else if (def.kind === "set") { + descriptor = { set: def.value, configurable: true, enumerable: false }; + } else if (def.kind === "field") { + descriptor = { configurable: true, writable: true, enumerable: true }; + } + + var element /*: ElementDescriptor */ = { + kind: def.kind === "field" ? "field" : "method", + key: key, + placement: def.static + ? "static" + : def.kind === "field" + ? "own" + : "prototype", + descriptor: descriptor, + }; + if (def.decorators) element.decorators = def.decorators; + if (def.kind === "field") element.initializer = def.value; + + return element; + } + + // CoalesceGetterSetter + function _coalesceGetterSetter( + element /*: ElementDescriptor */, + other /*: ElementDescriptor */, + ) { + if (element.descriptor.get !== undefined) { + other.descriptor.get = element.descriptor.get; + } else { + other.descriptor.set = element.descriptor.set; + } + } + + // CoalesceClassElements + function _coalesceClassElements( + elements /*: ElementDescriptor[] */, + ) /*: ElementDescriptor[] */ { + var newElements /*: ElementDescriptor[] */ = []; + + var isSameElement = function( + other /*: ElementDescriptor */, + ) /*: boolean */ { + return ( + other.kind === "method" && + other.key === element.key && + other.placement === element.placement + ); + }; + + for (var i = 0; i < elements.length; i++) { + var element /*: ElementDescriptor */ = elements[i]; + var other /*: ElementDescriptor */; + + if ( + element.kind === "method" && + (other = newElements.find(isSameElement)) + ) { + if ( + _isDataDescriptor(element.descriptor) || + _isDataDescriptor(other.descriptor) + ) { + if (_hasDecorators(element) || _hasDecorators(other)) { + throw new ReferenceError( + "Duplicated methods (" + element.key + ") can't be decorated.", + ); + } + other.descriptor = element.descriptor; + } else { + if (_hasDecorators(element)) { + if (_hasDecorators(other)) { + throw new ReferenceError( + "Decorators can't be placed on different accessors with for " + + "the same property (" + + element.key + + ").", + ); + } + other.decorators = element.decorators; + } + _coalesceGetterSetter(element, other); + } + } else { + newElements.push(element); + } + } + + return newElements; + } + + function _hasDecorators(element /*: ElementDescriptor */) /*: boolean */ { + return element.decorators && element.decorators.length; + } + + function _isDataDescriptor(desc /*: PropertyDescriptor */) /*: boolean */ { + return ( + desc !== undefined && + !(desc.value === undefined && desc.writable === undefined) + ); + } + + function _optionalCallableProperty /*::*/( + obj /*: T */, + name /*: $Keys */, + ) /*: ?Function */ { + var value = obj[name]; + if (value !== undefined && typeof value !== "function") { + throw new TypeError("Expected '" + name + "' to be a function"); + } + return value; + } + +`; +helpers.classPrivateMethodGet = helper("7.1.6")` + export default function _classPrivateMethodGet(receiver, privateSet, fn) { + if (!privateSet.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return fn; + } +`; +helpers.classPrivateMethodSet = helper("7.1.6")` + export default function _classPrivateMethodSet() { + throw new TypeError("attempted to reassign private method"); + } +`; +helpers.wrapRegExp = helper("7.2.6")` + import wrapNativeSuper from "wrapNativeSuper"; + import getPrototypeOf from "getPrototypeOf"; + import possibleConstructorReturn from "possibleConstructorReturn"; + import inherits from "inherits"; + + export default function _wrapRegExp(re, groups) { + _wrapRegExp = function(re, groups) { + return new BabelRegExp(re, undefined, groups); + }; + + var _RegExp = wrapNativeSuper(RegExp); + var _super = RegExp.prototype; + var _groups = new WeakMap(); + + function BabelRegExp(re, flags, groups) { + var _this = _RegExp.call(this, re, flags); + // if the regex is recreated with 'g' flag + _groups.set(_this, groups || _groups.get(re)); + return _this; + } + inherits(BabelRegExp, _RegExp); + + BabelRegExp.prototype.exec = function(str) { + var result = _super.exec.call(this, str); + if (result) result.groups = buildGroups(result, this); + return result; + }; + BabelRegExp.prototype[Symbol.replace] = function(str, substitution) { + if (typeof substitution === "string") { + var groups = _groups.get(this); + return _super[Symbol.replace].call( + this, + str, + substitution.replace(/\\$<([^>]+)>/g, function(_, name) { + return "$" + groups[name]; + }) + ); + } else if (typeof substitution === "function") { + var _this = this; + return _super[Symbol.replace].call( + this, + str, + function() { + var args = []; + args.push.apply(args, arguments); + if (typeof args[args.length - 1] !== "object") { + // Modern engines already pass result.groups as the last arg. + args.push(buildGroups(args, _this)); + } + return substitution.apply(this, args); + } + ); + } else { + return _super[Symbol.replace].call(this, str, substitution); + } + } + + function buildGroups(result, re) { + // NOTE: This function should return undefined if there are no groups, + // but in that case Babel doesn't add the wrapper anyway. + + var g = _groups.get(re); + return Object.keys(g).reduce(function(groups, name) { + groups[name] = result[g[name]]; + return groups; + }, Object.create(null)); + } + + return _wrapRegExp.apply(this, arguments); + } +`; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helpers/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/helpers/lib/index.js new file mode 100644 index 00000000000000..f122ac096cc00c --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helpers/lib/index.js @@ -0,0 +1,295 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.get = get; +exports.minVersion = minVersion; +exports.getDependencies = getDependencies; +exports.ensure = ensure; +exports.default = exports.list = void 0; + +var _traverse = _interopRequireDefault(require("@babel/traverse")); + +var t = _interopRequireWildcard(require("@babel/types")); + +var _helpers = _interopRequireDefault(require("./helpers")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function makePath(path) { + const parts = []; + + for (; path.parentPath; path = path.parentPath) { + parts.push(path.key); + if (path.inList) parts.push(path.listKey); + } + + return parts.reverse().join("."); +} + +let fileClass = undefined; + +function getHelperMetadata(file) { + const globals = new Set(); + const localBindingNames = new Set(); + const dependencies = new Map(); + let exportName; + let exportPath; + const exportBindingAssignments = []; + const importPaths = []; + const importBindingsReferences = []; + const dependencyVisitor = { + ImportDeclaration(child) { + const name = child.node.source.value; + + if (!_helpers.default[name]) { + throw child.buildCodeFrameError(`Unknown helper ${name}`); + } + + if (child.get("specifiers").length !== 1 || !child.get("specifiers.0").isImportDefaultSpecifier()) { + throw child.buildCodeFrameError("Helpers can only import a default value"); + } + + const bindingIdentifier = child.node.specifiers[0].local; + dependencies.set(bindingIdentifier, name); + importPaths.push(makePath(child)); + }, + + ExportDefaultDeclaration(child) { + const decl = child.get("declaration"); + + if (decl.isFunctionDeclaration()) { + if (!decl.node.id) { + throw decl.buildCodeFrameError("Helpers should give names to their exported func declaration"); + } + + exportName = decl.node.id.name; + } + + exportPath = makePath(child); + }, + + ExportAllDeclaration(child) { + throw child.buildCodeFrameError("Helpers can only export default"); + }, + + ExportNamedDeclaration(child) { + throw child.buildCodeFrameError("Helpers can only export default"); + }, + + Statement(child) { + if (child.isModuleDeclaration()) return; + child.skip(); + } + + }; + const referenceVisitor = { + Program(path) { + const bindings = path.scope.getAllBindings(); + Object.keys(bindings).forEach(name => { + if (name === exportName) return; + if (dependencies.has(bindings[name].identifier)) return; + localBindingNames.add(name); + }); + }, + + ReferencedIdentifier(child) { + const name = child.node.name; + const binding = child.scope.getBinding(name, true); + + if (!binding) { + globals.add(name); + } else if (dependencies.has(binding.identifier)) { + importBindingsReferences.push(makePath(child)); + } + }, + + AssignmentExpression(child) { + const left = child.get("left"); + if (!(exportName in left.getBindingIdentifiers())) return; + + if (!left.isIdentifier()) { + throw left.buildCodeFrameError("Only simple assignments to exports are allowed in helpers"); + } + + const binding = child.scope.getBinding(exportName); + + if (binding == null ? void 0 : binding.scope.path.isProgram()) { + exportBindingAssignments.push(makePath(child)); + } + } + + }; + (0, _traverse.default)(file.ast, dependencyVisitor, file.scope); + (0, _traverse.default)(file.ast, referenceVisitor, file.scope); + if (!exportPath) throw new Error("Helpers must default-export something."); + exportBindingAssignments.reverse(); + return { + globals: Array.from(globals), + localBindingNames: Array.from(localBindingNames), + dependencies, + exportBindingAssignments, + exportPath, + exportName, + importBindingsReferences, + importPaths + }; +} + +function permuteHelperAST(file, metadata, id, localBindings, getDependency) { + if (localBindings && !id) { + throw new Error("Unexpected local bindings for module-based helpers."); + } + + if (!id) return; + const { + localBindingNames, + dependencies, + exportBindingAssignments, + exportPath, + exportName, + importBindingsReferences, + importPaths + } = metadata; + const dependenciesRefs = {}; + dependencies.forEach((name, id) => { + dependenciesRefs[id.name] = typeof getDependency === "function" && getDependency(name) || id; + }); + const toRename = {}; + const bindings = new Set(localBindings || []); + localBindingNames.forEach(name => { + let newName = name; + + while (bindings.has(newName)) newName = "_" + newName; + + if (newName !== name) toRename[name] = newName; + }); + + if (id.type === "Identifier" && exportName !== id.name) { + toRename[exportName] = id.name; + } + + const visitor = { + Program(path) { + const exp = path.get(exportPath); + const imps = importPaths.map(p => path.get(p)); + const impsBindingRefs = importBindingsReferences.map(p => path.get(p)); + const decl = exp.get("declaration"); + + if (id.type === "Identifier") { + if (decl.isFunctionDeclaration()) { + exp.replaceWith(decl); + } else { + exp.replaceWith(t.variableDeclaration("var", [t.variableDeclarator(id, decl.node)])); + } + } else if (id.type === "MemberExpression") { + if (decl.isFunctionDeclaration()) { + exportBindingAssignments.forEach(assignPath => { + const assign = path.get(assignPath); + assign.replaceWith(t.assignmentExpression("=", id, assign.node)); + }); + exp.replaceWith(decl); + path.pushContainer("body", t.expressionStatement(t.assignmentExpression("=", id, t.identifier(exportName)))); + } else { + exp.replaceWith(t.expressionStatement(t.assignmentExpression("=", id, decl.node))); + } + } else { + throw new Error("Unexpected helper format."); + } + + Object.keys(toRename).forEach(name => { + path.scope.rename(name, toRename[name]); + }); + + for (const path of imps) path.remove(); + + for (const path of impsBindingRefs) { + const node = t.cloneNode(dependenciesRefs[path.node.name]); + path.replaceWith(node); + } + + path.stop(); + } + + }; + (0, _traverse.default)(file.ast, visitor, file.scope); +} + +const helperData = Object.create(null); + +function loadHelper(name) { + if (!helperData[name]) { + const helper = _helpers.default[name]; + + if (!helper) { + throw Object.assign(new ReferenceError(`Unknown helper ${name}`), { + code: "BABEL_HELPER_UNKNOWN", + helper: name + }); + } + + const fn = () => { + const file = { + ast: t.file(helper.ast()) + }; + + if (fileClass) { + return new fileClass({ + filename: `babel-helper://${name}` + }, file); + } + + return file; + }; + + const metadata = getHelperMetadata(fn()); + helperData[name] = { + build(getDependency, id, localBindings) { + const file = fn(); + permuteHelperAST(file, metadata, id, localBindings, getDependency); + return { + nodes: file.ast.program.body, + globals: metadata.globals + }; + }, + + minVersion() { + return helper.minVersion; + }, + + dependencies: metadata.dependencies + }; + } + + return helperData[name]; +} + +function get(name, getDependency, id, localBindings) { + return loadHelper(name).build(getDependency, id, localBindings); +} + +function minVersion(name) { + return loadHelper(name).minVersion(); +} + +function getDependencies(name) { + return Array.from(loadHelper(name).dependencies.values()); +} + +function ensure(name, newFileClass) { + if (!fileClass) { + fileClass = newFileClass; + } + + loadHelper(name); +} + +const list = Object.keys(_helpers.default).map(name => name.replace(/^_/, "")).filter(name => name !== "__esModule"); +exports.list = list; +var _default = get; +exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/helpers/package.json b/tools/node_modules/@babel/core/node_modules/@babel/helpers/package.json new file mode 100644 index 00000000000000..a02b06a19cc449 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/helpers/package.json @@ -0,0 +1,25 @@ +{ + "name": "@babel/helpers", + "version": "7.12.5", + "description": "Collection of helper functions used by Babel transforms.", + "author": "Sebastian McKenzie ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helpers" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" + }, + "devDependencies": { + "@babel/helper-plugin-test-runner": "7.10.4" + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/highlight/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/highlight/LICENSE new file mode 100644 index 00000000000000..f31575ec773bb1 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/highlight/LICENSE @@ -0,0 +1,22 @@ +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/tools/node_modules/babel-eslint/node_modules/@babel/highlight/README.md b/tools/node_modules/@babel/core/node_modules/@babel/highlight/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/highlight/README.md rename to tools/node_modules/@babel/core/node_modules/@babel/highlight/README.md diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/highlight/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/highlight/lib/index.js similarity index 57% rename from tools/node_modules/babel-eslint/node_modules/@babel/highlight/lib/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/highlight/lib/index.js index 6ac5b4a350b8e6..b0d1be7f553b64 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/highlight/lib/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/highlight/lib/index.js @@ -7,39 +7,17 @@ exports.shouldHighlight = shouldHighlight; exports.getChalk = getChalk; exports.default = highlight; -function _jsTokens() { - const data = _interopRequireWildcard(require("js-tokens")); +var _jsTokens = _interopRequireWildcard(require("js-tokens")); - _jsTokens = function () { - return data; - }; - - return data; -} - -function _esutils() { - const data = _interopRequireDefault(require("esutils")); +var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); - _esutils = function () { - return data; - }; - - return data; -} - -function _chalk() { - const data = _interopRequireDefault(require("chalk")); - - _chalk = function () { - return data; - }; - - return data; -} +var _chalk = _interopRequireDefault(require("chalk")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function getDefs(chalk) { return { @@ -61,10 +39,10 @@ const BRACKET = /^[()[\]{}]$/; function getTokenType(match) { const [offset, text] = match.slice(-2); - const token = (0, _jsTokens().matchToToken)(match); + const token = (0, _jsTokens.matchToToken)(match); if (token.type === "name") { - if (_esutils().default.keyword.isReservedWordES6(token.value)) { + if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) { return "keyword"; } @@ -89,7 +67,7 @@ function getTokenType(match) { } function highlightTokens(defs, text) { - return text.replace(_jsTokens().default, function (...args) { + return text.replace(_jsTokens.default, function (...args) { const type = getTokenType(args); const colorize = defs[type]; @@ -102,14 +80,14 @@ function highlightTokens(defs, text) { } function shouldHighlight(options) { - return _chalk().default.supportsColor || options.forceColor; + return _chalk.default.supportsColor || options.forceColor; } function getChalk(options) { - let chalk = _chalk().default; + let chalk = _chalk.default; if (options.forceColor) { - chalk = new (_chalk().default.constructor)({ + chalk = new _chalk.default.constructor({ enabled: true, level: 1 }); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/highlight/package.json b/tools/node_modules/@babel/core/node_modules/@babel/highlight/package.json similarity index 57% rename from tools/node_modules/babel-eslint/node_modules/@babel/highlight/package.json rename to tools/node_modules/@babel/core/node_modules/@babel/highlight/package.json index 9c16718356c0a9..9ff510e69ee161 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/highlight/package.json +++ b/tools/node_modules/@babel/core/node_modules/@babel/highlight/package.json @@ -1,30 +1,26 @@ { - "author": { - "name": "suchipi", - "email": "me@suchipi.com" - }, - "bundleDependencies": false, - "dependencies": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - }, - "deprecated": false, + "name": "@babel/highlight", + "version": "7.10.4", "description": "Syntax highlight JavaScript strings for output in terminals.", - "devDependencies": { - "strip-ansi": "^4.0.0" - }, - "gitHead": "49da9a07c81156e997e60146eb001ea77b7044c4", + "author": "suchipi ", "homepage": "https://babeljs.io/", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/highlight", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/babel-highlight" + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-highlight" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "devDependencies": { + "strip-ansi": "^4.0.0" }, - "version": "7.5.0" -} \ No newline at end of file + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df" +} diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/parser/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/parser/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/parser/LICENSE rename to tools/node_modules/@babel/core/node_modules/@babel/parser/LICENSE diff --git a/tools/node_modules/@babel/core/node_modules/@babel/parser/README.md b/tools/node_modules/@babel/core/node_modules/@babel/parser/README.md new file mode 100644 index 00000000000000..513748c3706dee --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/parser/README.md @@ -0,0 +1,19 @@ +# @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/tools/node_modules/babel-eslint/node_modules/@babel/parser/bin/babel-parser.js b/tools/node_modules/@babel/core/node_modules/@babel/parser/bin/babel-parser.js similarity index 57% rename from tools/node_modules/babel-eslint/node_modules/@babel/parser/bin/babel-parser.js rename to tools/node_modules/@babel/core/node_modules/@babel/parser/bin/babel-parser.js index 58f00b845c0cdd..3aca314533b3d3 100755 --- a/tools/node_modules/babel-eslint/node_modules/@babel/parser/bin/babel-parser.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/parser/bin/babel-parser.js @@ -7,10 +7,9 @@ var fs = require("fs"); var filename = process.argv[2]; if (!filename) { console.error("no filename specified"); - process.exit(0); -} - -var file = fs.readFileSync(filename, "utf8"); -var ast = parser.parse(file); +} else { + var file = fs.readFileSync(filename, "utf8"); + var ast = parser.parse(file); -console.log(JSON.stringify(ast, null, " ")); + console.log(JSON.stringify(ast, null, " ")); +} diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/parser/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js similarity index 52% rename from tools/node_modules/babel-eslint/node_modules/@babel/parser/lib/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js index 81b6994d07e99d..a37d8f6a4c85fc 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/parser/lib/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js @@ -10,6 +10,17 @@ 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; @@ -47,6 +58,9 @@ const types = { bigint: new TokenType("bigint", { startsExpr }), + decimal: new TokenType("decimal", { + startsExpr + }), regexp: new TokenType("regexp", { startsExpr }), @@ -61,7 +75,16 @@ const types = { beforeExpr, startsExpr }), + bracketHashL: new TokenType("#[", { + beforeExpr, + startsExpr + }), + bracketBarL: new TokenType("[|", { + beforeExpr, + startsExpr + }), bracketR: new TokenType("]"), + bracketBarR: new TokenType("|]"), braceL: new TokenType("{", { beforeExpr, startsExpr @@ -70,6 +93,10 @@ const types = { beforeExpr, startsExpr }), + braceHashL: new TokenType("#{", { + beforeExpr, + startsExpr + }), braceR: new TokenType("}"), braceBarR: new TokenType("|}"), parenL: new TokenType("(", { @@ -152,8 +179,14 @@ const types = { prefix, startsExpr }), - modulo: createBinop("%", 10), - star: createBinop("*", 10), + modulo: new TokenType("%", { + beforeExpr, + binop: 10, + startsExpr + }), + star: new TokenType("*", { + binop: 10 + }), slash: createBinop("/", 10), exponent: new TokenType("**", { beforeExpr, @@ -255,217 +288,631 @@ const types = { }) }; -const SCOPE_OTHER = 0b000000000, - SCOPE_PROGRAM = 0b000000001, - SCOPE_FUNCTION = 0b000000010, - SCOPE_ASYNC = 0b000000100, - SCOPE_GENERATOR = 0b000001000, - SCOPE_ARROW = 0b000010000, - SCOPE_SIMPLE_CATCH = 0b000100000, - SCOPE_SUPER = 0b001000000, - SCOPE_DIRECT_SUPER = 0b010000000, - SCOPE_CLASS = 0b100000000, - SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION; -function functionFlags(isAsync, isGenerator) { - return SCOPE_FUNCTION | (isAsync ? SCOPE_ASYNC : 0) | (isGenerator ? SCOPE_GENERATOR : 0); -} -const BIND_KIND_VALUE = 0b00000000001, - BIND_KIND_TYPE = 0b00000000010, - BIND_SCOPE_VAR = 0b00000000100, - BIND_SCOPE_LEXICAL = 0b00000001000, - BIND_SCOPE_FUNCTION = 0b00000010000, - BIND_FLAGS_NONE = 0b00001000000, - BIND_FLAGS_CLASS = 0b00010000000, - BIND_FLAGS_TS_ENUM = 0b00100000000, - BIND_FLAGS_TS_CONST_ENUM = 0b01000000000, - BIND_FLAGS_TS_EXPORT_ONLY = 0b10000000000; -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_FN_TYPE = 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 = BIND_TS_FN_TYPE; +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; -function isSimpleProperty(node) { - return node != null && node.type === "Property" && node.kind === "init" && node.method === false; + 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; -var estree = (superClass => class extends superClass { - estreeParseRegExpLiteral({ - pattern, - flags - }) { - let regex = null; + default: + return false; + } +} - try { - regex = new RegExp(pattern, flags); - } catch (e) {} +class Position { + constructor(line, col) { + this.line = void 0; + this.column = void 0; + this.line = line; + this.column = col; + } - const node = this.estreeParseLiteral(regex); - node.regex = { - pattern, - flags - }; - return node; +} +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; } - estreeParseLiteral(value) { - return this.parseLiteral(value, "Literal"); +} +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; } - 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.value; - 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); + return new Position(line, offset - lineStart); +} + +class BaseParser { + constructor() { + this.sawUnambiguousESM = false; + this.ambiguousScriptDifferentAst = false; } - initFunction(node, isAsync) { - super.initFunction(node, isAsync); - node.expression = false; + hasPlugin(name) { + return this.plugins.has(name); } - checkDeclaration(node) { - if (isSimpleProperty(node)) { - this.checkDeclaration(node.value); - } else { - super.checkDeclaration(node); - } + getPluginOption(plugin, name) { + if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name]; } - checkGetterSetterParams(method) { - const prop = method; - const paramCount = prop.kind === "get" ? 0 : 1; - const start = prop.start; +} - if (prop.value.params.length !== paramCount) { - if (prop.kind === "get") { - this.raise(start, "getter must not have any formal parameters"); - } else { - this.raise(start, "setter must have exactly one formal parameter"); - } - } +function last(stack) { + return stack[stack.length - 1]; +} - if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { - this.raise(start, "setter function argument must not be a rest parameter"); - } +class CommentsParser extends BaseParser { + addComment(comment) { + if (this.filename) comment.loc.filename = this.filename; + this.state.trailingComments.push(comment); + this.state.leadingComments.push(comment); } - checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) { - switch (expr.type) { - case "ObjectPattern": - expr.properties.forEach(prop => { - this.checkLVal(prop.type === "Property" ? prop.value : prop, bindingType, checkClashes, "object destructuring pattern"); - }); - break; + adjustCommentsAfterTrailingComma(node, elements, takeAllComments) { + if (this.state.leadingComments.length === 0) { + return; + } - default: - super.checkLVal(expr, bindingType, checkClashes, contextDescription); + let lastElement = null; + let i = elements.length; + + while (lastElement === null && i > 0) { + lastElement = elements[--i]; } - } - checkPropClash(prop, propHash) { - if (prop.type === "SpreadElement" || prop.computed || prop.method || prop.shorthand) { + if (lastElement === null) { return; } - const key = prop.key; - const name = key.type === "Identifier" ? key.name : String(key.value); - - if (name === "__proto__" && prop.kind === "init") { - if (propHash.proto) { - this.raise(key.start, "Redefinition of __proto__ property"); + 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--; } - - propHash.proto = true; } - } - isStrictBody(node) { - const isBlockStatement = node.body.type === "BlockStatement"; + const newTrailingComments = []; - if (isBlockStatement && node.body.body.length > 0) { - for (let _i = 0, _node$body$body = node.body.body; _i < _node$body$body.length; _i++) { - const directive = _node$body$body[_i]; + for (let i = 0; i < this.state.leadingComments.length; i++) { + const leadingComment = this.state.leadingComments[i]; - if (directive.type === "ExpressionStatement" && directive.expression.type === "Literal") { - if (directive.expression.value === "use strict") return true; - } else { - break; + 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); } } - return false; - } + if (takeAllComments) this.state.leadingComments = []; - isValidDirective(stmt) { - return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && (!stmt.expression.extra || !stmt.expression.extra.parenthesized); + if (newTrailingComments.length > 0) { + lastElement.trailingComments = newTrailingComments; + } else if (lastElement.trailingComments !== undefined) { + lastElement.trailingComments = []; + } } - stmtToDirective(stmt) { - const directive = super.stmtToDirective(stmt); - const value = stmt.expression.value; - directive.value.value = value; - return directive; - } + processComment(node) { + if (node.type === "Program" && node.body.length > 0) return; + const stack = this.state.commentStack; + let firstChild, lastChild, trailingComments, i, j; - parseBlockBody(node, allowDirectives, topLevel, end) { - super.parseBlockBody(node, allowDirectives, topLevel, end); - const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); - node.body = directiveStatements.concat(node.body); - delete node.directives; - } + 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); - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true); + if (lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { + trailingComments = lastInStack.trailingComments; + delete lastInStack.trailingComments; + } + } - if (method.typeParameters) { - method.value.typeParameters = method.typeParameters; - delete method.typeParameters; + if (stack.length > 0 && last(stack).start >= node.start) { + firstChild = stack.pop(); } - classBody.body.push(method); - } + while (stack.length > 0 && last(stack).start >= node.start) { + lastChild = stack.pop(); + } - parseExprAtom(refShorthandDefaultPos) { - switch (this.state.type) { - case types.regexp: - return this.estreeParseRegExpLiteral(this.state.value); + if (!lastChild && firstChild) lastChild = firstChild; - case types.num: - case types.string: - return this.estreeParseLiteral(this.state.value); + if (firstChild) { + switch (node.type) { + case "ObjectExpression": + this.adjustCommentsAfterTrailingComma(node, node.properties); + break; - case types._null: - return this.estreeParseLiteral(null); + case "ObjectPattern": + this.adjustCommentsAfterTrailingComma(node, node.properties, true); + break; - case types._true: - return this.estreeParseLiteral(true); + case "CallExpression": + this.adjustCommentsAfterTrailingComma(node, node.arguments); + break; - case types._false: - return this.estreeParseLiteral(false); + case "ArrayExpression": + this.adjustCommentsAfterTrailingComma(node, node.elements); + break; - default: - return super.parseExprAtom(refShorthandDefaultPos); + 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]); } - } - parseLiteral(value, type, startPos, startLoc) { - const node = super.parseLiteral(value, type, startPos, startLoc); - node.raw = node.extra.raw; - delete node.extra; - return node; + 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", + 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.", + 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); + } + + 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; + } + } + +} + +function isSimpleProperty(node) { + return node != null && node.type === "Property" && node.kind === "init" && node.method === false; +} + +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) { + const bigInt = typeof BigInt !== "undefined" ? BigInt(value) : 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.value; + 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 (isSimpleProperty(node)) { + this.checkDeclaration(node.value); + } else { + super.checkDeclaration(node); + } + } + + getObjectOrClassMethodParams(method) { + return method.value.params; + } + + checkLVal(expr, contextDescription, ...args) { + switch (expr.type) { + case "ObjectPattern": + expr.properties.forEach(prop => { + this.checkLVal(prop.type === "Property" ? prop.value : prop, "object destructuring pattern", ...args); + }); + break; + + default: + super.checkLVal(expr, contextDescription, ...args); + } + } + + checkProto(prop, isRecord, protoRef, refExpressionErrors) { + if (prop.method) { + return; + } + + super.checkProto(prop, isRecord, protoRef, refExpressionErrors); + } + + 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; + directive.value.value = value; + return directive; + } + + parseBlockBody(node, allowDirectives, topLevel, end) { + super.parseBlockBody(node, allowDirectives, topLevel, end); + 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); + } + } + + 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) { @@ -484,8 +931,8 @@ var estree = (superClass => class extends superClass { return this.finishNode(node, type); } - parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) { - const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc); + parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { + const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor); if (node) { node.type = "Property"; @@ -496,8 +943,8 @@ var estree = (superClass => class extends superClass { return node; } - parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos) { - const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos); + parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) { + const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors); if (node) { node.kind = "init"; @@ -507,74 +954,95 @@ var estree = (superClass => class extends superClass { return node; } - toAssignable(node, isBinding, contextDescription) { + toAssignable(node, isLHS = false) { if (isSimpleProperty(node)) { - this.toAssignable(node.value, isBinding, contextDescription); + this.toAssignable(node.value); return node; } - return super.toAssignable(node, isBinding, contextDescription); + return super.toAssignable(node, isLHS); } - toAssignableObjectExpressionProp(prop, isBinding, isLast) { + toAssignableObjectExpressionProp(prop, ...args) { if (prop.kind === "get" || prop.kind === "set") { - this.raise(prop.key.start, "Object pattern can't contain getter or setter"); + throw this.raise(prop.key.start, ErrorMessages.PatternHasAccessor); } else if (prop.method) { - this.raise(prop.key.start, "Object pattern can't contain methods"); + throw this.raise(prop.key.start, ErrorMessages.PatternHasMethod); } else { - super.toAssignableObjectExpressionProp(prop, isBinding, isLast); + super.toAssignableObjectExpressionProp(prop, ...args); } } -}); + finishCallExpression(node, optional) { + super.finishCallExpression(node, optional); -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; + if (node.callee.type === "Import") { + node.type = "ImportExpression"; + node.source = node.arguments[0]; + delete node.arguments; + delete node.callee; + } - default: - return false; + return node; } -} -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; + 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; + } + +}); 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; @@ -585,6 +1053,7 @@ class TokContext { 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), @@ -612,7 +1081,7 @@ types.name.updateContext = function (prevType) { let allowed = false; if (prevType !== types.dot) { - if (this.state.value === "of" && !this.state.exprAllowed || this.state.value === "yield" && this.scope.inGenerator) { + if (this.state.value === "of" && !this.state.exprAllowed && prevType !== types._function && prevType !== types._class) { allowed = true; } } @@ -643,7 +1112,7 @@ types.parenL.updateContext = function (prevType) { types.incDec.updateContext = function () {}; types._function.updateContext = types._class.updateContext = function (prevType) { - if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && !(prevType === types._return && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) && !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) { + 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); @@ -662,32 +1131,18 @@ types.backQuote.updateContext = function () { this.state.exprAllowed = false; }; -const reservedWords = { - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] -}; -const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set(reservedWords.strict.concat(reservedWords.strictBind)); -const isReservedWord = (word, inModule) => { - return inModule && word === "await" || word === "enum"; +types.braceHashL.updateContext = function () { + this.state.context.push(types$1.recordExpression); + this.state.exprAllowed = true; }; -function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); -} -function isStrictBindReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictBindSet.has(word); -} -function isKeyword(word) { - return keywords.has(word); -} -const keywordRelationalOperator = /^in(stanceof)?$/; -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-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -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\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + +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, 477, 28, 11, 0, 9, 21, 155, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 12, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 0, 33, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 0, 161, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 270, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 754, 9486, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541]; -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, 525, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 232, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 792487, 239]; +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; @@ -714,9 +1169,6 @@ function isIdentifierStart(code) { return isInAstralSet(code, astralIdentifierStartCodes); } -function isIteratorStart(current, next) { - return current === 64 && next === 64; -} function isIdentifierChar(code) { if (code < 48) return code === 36; if (code < 58) return true; @@ -732,7 +1184,120 @@ function isIdentifierChar(code) { return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); } -const reservedTypes = ["any", "bool", "boolean", "empty", "false", "mixed", "null", "number", "static", "string", "true", "typeof", "void", "interface", "extends", "_"]; +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 = 0b00000000, + SCOPE_PROGRAM = 0b00000001, + SCOPE_FUNCTION = 0b00000010, + SCOPE_ARROW = 0b00000100, + SCOPE_SIMPLE_CATCH = 0b00001000, + SCOPE_SUPER = 0b00010000, + SCOPE_DIRECT_SUPER = 0b00100000, + SCOPE_CLASS = 0b01000000, + SCOPE_TS_MODULE = 0b10000000, + SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE; +const BIND_KIND_VALUE = 0b00000000001, + BIND_KIND_TYPE = 0b00000000010, + BIND_SCOPE_VAR = 0b00000000100, + BIND_SCOPE_LEXICAL = 0b00000001000, + BIND_SCOPE_FUNCTION = 0b00000010000, + BIND_FLAGS_NONE = 0b00001000000, + BIND_FLAGS_CLASS = 0b00010000000, + BIND_FLAGS_TS_ENUM = 0b00100000000, + BIND_FLAGS_TS_CONST_ENUM = 0b01000000000, + BIND_FLAGS_TS_EXPORT_ONLY = 0b10000000000; +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; +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; + +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`.", + 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.", + SpreadVariance: "Spread properties cannot have variance", + 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"); @@ -753,2166 +1318,2747 @@ const exportSuggestions = { interface: "export interface" }; -function partition(list, test) { - const list1 = []; - const list2 = []; +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(options, input) { + super(options, input); + this.flowPragma = void 0; + this.flowPragma = undefined; + } + + 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; + 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(); + 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(); + } - for (let i = 0; i < list.length; i++) { - (test(list[i], i, list) ? list1 : list2).push(list[i]); - } + return this.finishNode(node, "ObjectTypeInternalSlot"); + } - return [list1, list2]; -} + flowParseObjectTypeMethodish(node) { + node.params = []; + node.rest = null; + node.typeParameters = null; -const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; -var flow = (superClass => class extends superClass { - constructor(options, input) { - super(options, input); - this.flowPragma = undefined; - } + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } - shouldParseTypes() { - return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; - } + this.expect(types.parenL); - finishToken(type, val) { - if (type !== types.string && type !== types.semi && type !== types.interpreterDirective) { - if (this.flowPragma === undefined) { - this.flowPragma = null; + while (!this.match(types.parenR) && !this.match(types.ellipsis)) { + node.params.push(this.flowParseFunctionTypeParam()); + + if (!this.match(types.parenR)) { + this.expect(types.comma); + } } - } - return super.finishToken(type, val); - } + if (this.eat(types.ellipsis)) { + node.rest = this.flowParseFunctionTypeParam(); + } - addComment(comment) { - if (this.flowPragma === undefined) { - const matches = FLOW_PRAGMA_REGEX.exec(comment.value); + this.expect(types.parenR); + node.returnType = this.flowParseTypeInitialiser(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } - if (!matches) ; else if (matches[1] === "flow") { - this.flowPragma = "flow"; - } else if (matches[1] === "noflow") { - this.flowPragma = "noflow"; + 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 { - throw new Error("Unexpected flow pragma"); + this.expect(types.braceL); + endDelim = types.braceR; + exact = false; } - } - return super.addComment(comment); - } + nodeStart.exact = exact; - 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; - } + while (!this.match(endDelim)) { + let isStatic = false; + let protoStart = null; + let inexactStart = null; + const node = this.startNode(); - 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 (allowProto && this.isContextual("proto")) { + const lookahead = this.lookahead(); - if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) { - this.raise(moduloPos, "Spaces between ´%´ and ´checks´ are not allowed here."); - } + if (lookahead.type !== types.colon && lookahead.type !== types.question) { + this.next(); + protoStart = this.state.start; + allowStatic = false; + } + } - if (this.eat(types.parenL)) { - node.value = this.parseExpression(); - this.expect(types.parenR); - return this.finishNode(node, "DeclaredPredicate"); - } else { - return this.finishNode(node, "InferredPredicate"); - } - } + if (allowStatic && this.isContextual("static")) { + const lookahead = this.lookahead(); - flowParseTypeAndPredicateInitialiser() { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(types.colon); - let type = null; - let predicate = null; + if (lookahead.type !== types.colon && lookahead.type !== types.question) { + this.next(); + isStatic = true; + } + } - if (this.match(types.modulo)) { - this.state.inType = oldInType; - predicate = this.flowParsePredicate(); - } else { - type = this.flowParseType(); - this.state.inType = oldInType; + const variance = this.flowParseVariance(); - if (this.match(types.modulo)) { - predicate = this.flowParsePredicate(); - } - } + if (this.eat(types.bracketL)) { + if (protoStart != null) { + this.unexpected(protoStart); + } - return [type, predicate]; - } + if (this.eat(types.bracketL)) { + if (variance) { + this.unexpected(variance.start); + } - flowParseDeclareClass(node) { - this.next(); - this.flowParseInterfaceish(node, true); - return this.finishNode(node, "DeclareClass"); - } + 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); + } - flowParseDeclareFunction(node) { - this.next(); - const id = node.id = this.parseIdentifier(); - const typeNode = this.startNode(); - const typeContainer = this.startNode(); + if (variance) { + this.unexpected(variance.start); + } - if (this.isRelational("<")) { - typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - typeNode.typeParameters = null; - } + nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + } else { + let kind = "init"; - this.expect(types.parenL); - const tmp = this.flowParseFunctionTypeParams(); - typeNode.params = tmp.params; - typeNode.rest = tmp.rest; - 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(); - 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.unexpected(this.state.lastTokStart, "`declare module` cannot be used inside another `declare module`"); + 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); + } } - return this.flowParseDeclareModule(node); + this.flowObjectTypeSemicolon(); + + if (inexactStart && !this.match(types.braceR) && !this.match(types.braceBarR)) { + this.raise(inexactStart, FlowErrors.UnexpectedExplicitInexactInObject); + } } - } 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.semicolon(); - return this.finishNode(node, "DeclareVariable"); - } + this.expect(endDelim); - flowParseDeclareModule(node) { - this.scope.enter(SCOPE_OTHER); + if (allowSpread) { + nodeStart.inexact = inexact; + } - if (this.match(types.string)) { - node.id = this.parseExprAtom(); - } else { - node.id = this.parseIdentifier(); + const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); + this.state.inType = oldInType; + return out; } - const bodyNode = node.body = this.startNode(); - const body = bodyNode.body = []; - this.expect(types.braceL); + 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); - while (!this.match(types.braceR)) { - let bodyNode = this.startNode(); + if (isInexactToken) { + if (!allowSpread) { + this.raise(this.state.lastTokStart, FlowErrors.InexactInsideNonObject); + } else if (!allowInexact) { + this.raise(this.state.lastTokStart, FlowErrors.InexactInsideExact); + } - if (this.match(types._import)) { - this.next(); + if (variance) { + this.raise(variance.start, FlowErrors.InexactVariance); + } - if (!this.isContextual("type") && !this.match(types._typeof)) { - this.unexpected(this.state.lastTokStart, "Imports within a `declare module` body must always be `import type` or `import typeof`"); + return null; } - this.parseImport(bodyNode); - } else { - this.expectContextual("declare", "Only declares and type imports are allowed inside declare module"); - bodyNode = this.flowParseDeclare(bodyNode, true); - } - - body.push(bodyNode); - } + if (!allowSpread) { + this.raise(this.state.lastTokStart, FlowErrors.UnexpectedSpreadType); + } - this.scope.exit(); - this.expect(types.braceR); - this.finishNode(bodyNode, "BlockStatement"); - let kind = null; - let hasModuleExport = false; - const errorMessage = "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"; - body.forEach(bodyElement => { - if (isEsModuleType(bodyElement)) { - if (kind === "CommonJS") { - this.unexpected(bodyElement.start, errorMessage); + if (protoStart != null) { + this.unexpected(protoStart); } - kind = "ES"; - } else if (bodyElement.type === "DeclareModuleExports") { - if (hasModuleExport) { - this.unexpected(bodyElement.start, "Duplicate `declare module.exports` statement"); + if (variance) { + this.raise(variance.start, FlowErrors.SpreadVariance); } - if (kind === "ES") this.unexpected(bodyElement.start, errorMessage); - kind = "CommonJS"; - hasModuleExport = true; - } - }); - node.kind = kind || "CommonJS"; - return this.finishNode(node, "DeclareModule"); - } + 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; - flowParseDeclareExportDeclaration(node, insideModule) { - this.expect(types._export); + if (this.isRelational("<") || this.match(types.parenL)) { + node.method = true; - 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(); - } + if (protoStart != null) { + this.unexpected(protoStart); + } - 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]; - this.unexpected(this.state.start, `\`declare export ${label}\` is not supported. Use \`${suggestion}\` instead`); - } + if (variance) { + this.unexpected(variance.start); + } - 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); + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); - if (node.type === "ExportNamedDeclaration") { - node.type = "ExportDeclaration"; - node.default = false; - delete node.exportKind; + if (kind === "get" || kind === "set") { + this.flowCheckGetterSetterParams(node); } + } else { + if (kind !== "init") this.unexpected(); + node.method = false; - node.type = "Declare" + node.type; - return node; + if (this.eat(types.question)) { + optional = true; + } + + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; } + + node.optional = optional; + return this.finishNode(node, "ObjectTypeProperty"); + } } - throw this.unexpected(); - } + flowCheckGetterSetterParams(property) { + const paramCount = property.kind === "get" ? 0 : 1; + const start = property.start; + const length = property.value.params.length + (property.value.rest ? 1 : 0); - flowParseDeclareModuleExports(node) { - this.next(); - this.expectContextual("exports"); - node.typeAnnotation = this.flowParseTypeAnnotation(); - this.semicolon(); - return this.finishNode(node, "DeclareModuleExports"); - } + if (length !== paramCount) { + if (property.kind === "get") { + this.raise(start, ErrorMessages.BadGetterArity); + } else { + this.raise(start, ErrorMessages.BadSetterArity); + } + } - flowParseDeclareTypeAlias(node) { - this.next(); - this.flowParseTypeAlias(node); - node.type = "DeclareTypeAlias"; - return node; - } + if (property.kind === "set" && property.value.rest) { + this.raise(start, ErrorMessages.BadSetterRestParameter); + } + } - flowParseDeclareOpaqueType(node) { - this.next(); - this.flowParseOpaqueType(node, true); - node.type = "DeclareOpaqueType"; - return node; - } + flowObjectTypeSemicolon() { + if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) { + this.unexpected(); + } + } - flowParseDeclareInterface(node) { - this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareInterface"); - } + flowParseQualifiedTypeIdentifier(startPos, startLoc, id) { + startPos = startPos || this.state.start; + startLoc = startLoc || this.state.startLoc; + let node = id || this.flowParseRestrictedIdentifier(true); - flowParseInterfaceish(node, isClass = false) { - node.id = this.flowParseRestrictedIdentifier(!isClass); + while (this.eat(types.dot)) { + const node2 = this.startNodeAt(startPos, startLoc); + node2.qualification = node; + node2.id = this.flowParseRestrictedIdentifier(true); + node = this.finishNode(node2, "QualifiedTypeIdentifier"); + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; + return node; } - node.extends = []; - node.implements = []; - node.mixins = []; - - if (this.eat(types._extends)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (!isClass && this.eat(types.comma)); - } + flowParseGenericType(startPos, startLoc, id) { + const node = this.startNodeAt(startPos, startLoc); + node.typeParameters = null; + node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); - if (this.isContextual("mixins")) { - this.next(); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } - do { - node.mixins.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); + return this.finishNode(node, "GenericTypeAnnotation"); } - if (this.isContextual("implements")) { - this.next(); - - do { - node.implements.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); + flowParseTypeofType() { + const node = this.startNode(); + this.expect(types._typeof); + node.argument = this.flowParsePrimaryType(); + return this.finishNode(node, "TypeofTypeAnnotation"); } - node.body = this.flowParseObjectType({ - allowStatic: isClass, - allowExact: false, - allowSpread: false, - allowProto: isClass, - allowInexact: false - }); - } + flowParseTupleType() { + const node = this.startNode(); + node.types = []; + this.expect(types.bracketL); - flowParseInterfaceExtends() { - const node = this.startNode(); - node.id = this.flowParseQualifiedTypeIdentifier(); + 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); + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; + this.expect(types.bracketR); + return this.finishNode(node, "TupleTypeAnnotation"); } - return this.finishNode(node, "InterfaceExtends"); - } + flowParseFunctionTypeParam() { + let name = null; + let optional = false; + let typeAnnotation = null; + const node = this.startNode(); + const lh = this.lookahead(); - flowParseInterface(node) { - this.flowParseInterfaceish(node); - return this.finishNode(node, "InterfaceDeclaration"); - } + if (lh.type === types.colon || lh.type === types.question) { + name = this.parseIdentifier(); - checkNotUnderscore(word) { - if (word === "_") { - throw this.unexpected(null, "`_` is only allowed as a type argument to call or new"); - } - } + if (this.eat(types.question)) { + optional = true; + } + + typeAnnotation = this.flowParseTypeInitialiser(); + } else { + typeAnnotation = this.flowParseType(); + } - checkReservedType(word, startLoc) { - if (reservedTypes.indexOf(word) > -1) { - this.raise(startLoc, `Cannot overwrite reserved type ${word}`); + node.name = name; + node.optional = optional; + node.typeAnnotation = typeAnnotation; + return this.finishNode(node, "FunctionTypeParam"); } - } - flowParseRestrictedIdentifier(liberal) { - this.checkReservedType(this.state.value, this.state.start); - return this.parseIdentifier(liberal); - } + 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"); + } - flowParseTypeAlias(node) { - node.id = this.flowParseRestrictedIdentifier(); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); + flowParseFunctionTypeParams(params = []) { + let rest = null; - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } + while (!this.match(types.parenR) && !this.match(types.ellipsis)) { + params.push(this.flowParseFunctionTypeParam()); - node.right = this.flowParseTypeInitialiser(types.eq); - this.semicolon(); - return this.finishNode(node, "TypeAlias"); - } + if (!this.match(types.parenR)) { + this.expect(types.comma); + } + } - flowParseOpaqueType(node, declare) { - this.expectContextual("type"); - node.id = this.flowParseRestrictedIdentifier(true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); + if (this.eat(types.ellipsis)) { + rest = this.flowParseFunctionTypeParam(); + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; + return { + params, + rest + }; } - node.supertype = null; + flowIdentToTypeAnnotation(startPos, startLoc, node, id) { + switch (id.name) { + case "any": + return this.finishNode(node, "AnyTypeAnnotation"); - if (this.match(types.colon)) { - node.supertype = this.flowParseTypeInitialiser(types.colon); - } + case "bool": + case "boolean": + return this.finishNode(node, "BooleanTypeAnnotation"); - node.impltype = null; + case "mixed": + return this.finishNode(node, "MixedTypeAnnotation"); - if (!declare) { - node.impltype = this.flowParseTypeInitialiser(types.eq); - } + case "empty": + return this.finishNode(node, "EmptyTypeAnnotation"); - this.semicolon(); - return this.finishNode(node, "OpaqueType"); - } + case "number": + return this.finishNode(node, "NumberTypeAnnotation"); - 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.unexpected(nodeStart, "Type parameter declaration needs a default, since a preceding type parameter declaration has a default."); + 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); } } - return this.finishNode(node, "TypeParameter"); - } - - flowParseTypeParameterDeclaration() { - const oldInType = this.state.inType; - const node = this.startNode(); - node.params = []; - this.state.inType = true; + 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; - if (this.isRelational("<") || this.match(types.jsxTagStart)) { - this.next(); - } else { - this.unexpected(); - } + switch (this.state.type) { + case types.name: + if (this.isContextual("interface")) { + return this.flowParseInterfaceType(); + } - let defaultRequired = false; + 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; + this.expect(types.parenR); + this.expect(types.arrow); + node.returnType = this.flowParseType(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } - do { - const typeParameter = this.flowParseTypeParameter(defaultRequired); - node.params.push(typeParameter); + break; - if (typeParameter.default) { - defaultRequired = true; - } + case types.parenL: + this.next(); - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } while (!this.isRelational(">")); + if (!this.match(types.parenR) && !this.match(types.ellipsis)) { + if (this.match(types.name)) { + const token = this.lookahead().type; + isGroupedType = token !== types.question && token !== types.colon; + } else { + isGroupedType = true; + } + } - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterDeclaration"); - } + if (isGroupedType) { + this.state.noAnonFunctionType = false; + type = this.flowParseType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; - 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; + 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); + } + } - while (!this.isRelational(">")) { - node.params.push(this.flowParseType()); + if (type) { + tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); + } else { + tmp = this.flowParseFunctionTypeParams(); + } - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } + node.params = tmp.params; + node.rest = tmp.rest; + this.expect(types.parenR); + this.expect(types.arrow); + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } + case types.string: + return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); - flowParseTypeParameterInstantiationCallOrNew() { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expectRelational("<"); + case types._true: + case types._false: + node.value = this.match(types._true); + this.next(); + return this.finishNode(node, "BooleanLiteralTypeAnnotation"); - while (!this.isRelational(">")) { - node.params.push(this.flowParseTypeOrImplicitInstantiation()); + case types.plusMin: + if (this.state.value === "-") { + this.next(); - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } + if (this.match(types.num)) { + return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); + } - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } + if (this.match(types.bigint)) { + return this.parseLiteral(-this.state.value, "BigIntLiteralTypeAnnotation", node.start, node.loc.start); + } - flowParseInterfaceType() { - const node = this.startNode(); - this.expectContextual("interface"); - node.extends = []; + throw this.raise(this.state.start, FlowErrors.UnexpectedSubtractionOperand); + } - if (this.eat(types._extends)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); - } + throw this.unexpected(); - node.body = this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: false, - allowProto: false, - allowInexact: false - }); - return this.finishNode(node, "InterfaceTypeAnnotation"); - } + case types.num: + return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); - flowParseObjectPropertyKey() { - return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true); - } + case types.bigint: + return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); - flowParseObjectTypeIndexer(node, isStatic, variance) { - node.static = isStatic; + case types._void: + this.next(); + return this.finishNode(node, "VoidTypeAnnotation"); - if (this.lookahead().type === types.colon) { - node.id = this.flowParseObjectPropertyKey(); - node.key = this.flowParseTypeInitialiser(); - } else { - node.id = null; - node.key = this.flowParseType(); - } + case types._null: + this.next(); + return this.finishNode(node, "NullLiteralTypeAnnotation"); - this.expect(types.bracketR); - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - return this.finishNode(node, "ObjectTypeIndexer"); - } + case types._this: + this.next(); + return this.finishNode(node, "ThisTypeAnnotation"); - flowParseObjectTypeInternalSlot(node, isStatic) { - node.static = isStatic; - node.id = this.flowParseObjectPropertyKey(); - this.expect(types.bracketR); - this.expect(types.bracketR); + case types.star: + this.next(); + return this.finishNode(node, "ExistsTypeAnnotation"); - 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; + 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); + } - if (this.eat(types.question)) { - node.optional = true; } - node.value = this.flowParseTypeInitialiser(); + throw this.unexpected(); } - return this.finishNode(node, "ObjectTypeInternalSlot"); - } + flowParsePostfixType() { + const startPos = this.state.start, + startLoc = this.state.startLoc; + let type = this.flowParsePrimaryType(); - flowParseObjectTypeMethodish(node) { - node.params = []; - node.rest = null; - node.typeParameters = null; + 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"); + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); + return type; } - this.expect(types.parenL); - - while (!this.match(types.parenR) && !this.match(types.ellipsis)) { - node.params.push(this.flowParseFunctionTypeParam()); + flowParsePrefixType() { + const node = this.startNode(); - if (!this.match(types.parenR)) { - this.expect(types.comma); + if (this.eat(types.question)) { + node.typeAnnotation = this.flowParsePrefixType(); + return this.finishNode(node, "NullableTypeAnnotation"); + } else { + return this.flowParsePostfixType(); } } - if (this.eat(types.ellipsis)) { - node.rest = this.flowParseFunctionTypeParam(); - } - - this.expect(types.parenR); - node.returnType = this.flowParseTypeInitialiser(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } + flowParseAnonFunctionWithoutParens() { + const param = this.flowParsePrefixType(); - flowParseObjectTypeCallProperty(node, isStatic) { - const valueNode = this.startNode(); - node.static = isStatic; - node.value = this.flowParseObjectTypeMethodish(valueNode); - return this.finishNode(node, "ObjectTypeCallProperty"); - } + 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"); + } - 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; + return param; } - nodeStart.exact = exact; - - while (!this.match(endDelim)) { - let isStatic = false; - let protoStart = null; + flowParseIntersectionType() { const node = this.startNode(); + this.eat(types.bitwiseAND); + const type = this.flowParseAnonFunctionWithoutParens(); + node.types = [type]; - 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; - } + while (this.eat(types.bitwiseAND)) { + node.types.push(this.flowParseAnonFunctionWithoutParens()); } - const variance = this.flowParseVariance(); + return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); + } - if (this.eat(types.bracketL)) { - if (protoStart != null) { - this.unexpected(protoStart); - } + flowParseUnionType() { + const node = this.startNode(); + this.eat(types.bitwiseOR); + const type = this.flowParseIntersectionType(); + node.types = [type]; - if (this.eat(types.bracketL)) { - if (variance) { - this.unexpected(variance.start); - } + while (this.eat(types.bitwiseOR)) { + node.types.push(this.flowParseIntersectionType()); + } - 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); - } + return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); + } - if (variance) { - this.unexpected(variance.start); - } + 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; + } - nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + 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 { - let kind = "init"; - - if (this.isContextual("get") || this.isContextual("set")) { - const lookahead = this.lookahead(); + return this.flowParseType(); + } + } - if (lookahead.type === types.name || lookahead.type === types.string || lookahead.type === types.num) { - kind = this.state.value; - this.next(); - } - } + flowParseTypeAnnotation() { + const node = this.startNode(); + node.typeAnnotation = this.flowParseTypeInitialiser(); + return this.finishNode(node, "TypeAnnotation"); + } - const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact); + flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { + const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); - if (propOrInexact === null) { - inexact = true; - } else { - nodeStart.properties.push(propOrInexact); - } + if (this.match(types.colon)) { + ident.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(ident); } - this.flowObjectTypeSemicolon(); + return ident; } - this.expect(endDelim); - - if (allowSpread) { - nodeStart.inexact = inexact; + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end); + return node.expression; } - const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); - this.state.inType = oldInType; - return out; - } + flowParseVariance() { + let variance = null; - flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) { - if (this.match(types.ellipsis)) { - if (!allowSpread) { - this.unexpected(null, "Spread operator cannot appear in class or interface definitions"); - } + if (this.match(types.plusMin)) { + variance = this.startNode(); - if (protoStart != null) { - this.unexpected(protoStart); - } + if (this.state.value === "+") { + variance.kind = "plus"; + } else { + variance.kind = "minus"; + } - if (variance) { - this.unexpected(variance.start, "Spread properties cannot have variance"); + this.next(); + this.finishNode(variance, "Variance"); } - this.expect(types.ellipsis); - const isInexactToken = this.eat(types.comma) || this.eat(types.semi); + return variance; + } - if (this.match(types.braceR)) { - if (allowInexact) return null; - this.unexpected(null, "Explicit inexact syntax is only allowed inside inexact objects"); + parseFunctionBody(node, allowExpressionBody, isMethod = false) { + if (allowExpressionBody) { + return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); } - if (this.match(types.braceBarR)) { - this.unexpected(null, "Explicit inexact syntax cannot appear inside an explicit exact object type"); - } + return super.parseFunctionBody(node, false, isMethod); + } - if (isInexactToken) { - this.unexpected(null, "Explicit inexact syntax must appear at the end of an inexact object"); + 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; } - 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; + super.parseFunctionBodyAndFinish(node, type, isMethod); + } - if (this.isRelational("<") || this.match(types.parenL)) { - node.method = true; + parseStatement(context, topLevel) { + if (this.state.strict && this.match(types.name) && this.state.value === "interface") { + const lookahead = this.lookahead(); - if (protoStart != null) { - this.unexpected(protoStart); + 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); + } - if (variance) { - this.unexpected(variance.start); - } + const stmt = super.parseStatement(context, topLevel); - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); + if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { + this.flowPragma = null; + } - if (kind === "get" || kind === "set") { - this.flowCheckGetterSetterParams(node); - } - } else { - if (kind !== "init") this.unexpected(); - node.method = false; + return stmt; + } - if (this.eat(types.question)) { - optional = true; + 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); + } } - - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; } - node.optional = optional; - return this.finishNode(node, "ObjectTypeProperty"); + return super.parseExpressionStatement(node, expr); } - } - 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 (length !== paramCount) { - if (property.kind === "get") { - this.raise(start, "getter must not have any formal parameters"); - } else { - this.raise(start, "setter must have exactly one formal parameter"); - } + shouldParseExportDeclaration() { + return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || this.shouldParseEnums() && this.isContextual("enum") || super.shouldParseExportDeclaration(); } - if (property.kind === "set" && property.value.rest) { - this.raise(start, "setter function argument must not be a rest parameter"); - } - } + 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; + } - flowObjectTypeSemicolon() { - if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) { - this.unexpected(); + return super.isExportDefaultSpecifier(); } - } - flowParseQualifiedTypeIdentifier(startPos, startLoc, id) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - let node = id || this.parseIdentifier(); + parseExportDefaultExpression() { + if (this.shouldParseEnums() && this.isContextual("enum")) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } - while (this.eat(types.dot)) { - const node2 = this.startNodeAt(startPos, startLoc); - node2.qualification = node; - node2.id = this.parseIdentifier(); - node = this.finishNode(node2, "QualifiedTypeIdentifier"); + return super.parseExportDefaultExpression(); } - return node; - } + parseConditional(expr, startPos, startLoc, refNeedsArrowPos) { + if (!this.match(types.question)) return expr; - flowParseGenericType(startPos, startLoc, id) { - const node = this.startNodeAt(startPos, startLoc); - node.typeParameters = null; - node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); + if (refNeedsArrowPos) { + const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc)); - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } + if (!result.node) { + refNeedsArrowPos.start = result.error.pos || this.state.start; + return expr; + } - return this.finishNode(node, "GenericTypeAnnotation"); - } + if (result.error) this.state = result.failState; + return result.node; + } - flowParseTypeofType() { - const node = this.startNode(); - this.expect(types._typeof); - node.argument = this.flowParsePrimaryType(); - return this.finishNode(node, "TypeofTypeAnnotation"); - } + 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); - flowParseTupleType() { - const node = this.startNode(); - node.types = []; - this.expect(types.bracketL); + if (failed || invalid.length > 0) { + const noArrowAt = [...originalNoArrowAt]; - 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); - } + if (invalid.length > 0) { + this.state = state; + this.state.noArrowAt = noArrowAt; - this.expect(types.bracketR); - return this.finishNode(node, "TupleTypeAnnotation"); - } + for (let i = 0; i < invalid.length; i++) { + noArrowAt.push(invalid[i].start); + } - flowParseFunctionTypeParam() { - let name = null; - let optional = false; - let typeAnnotation = null; - const node = this.startNode(); - const lh = this.lookahead(); + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + [valid, invalid] = this.getArrowLikeExpressions(consequent); + } - if (lh.type === types.colon || lh.type === types.question) { - name = this.parseIdentifier(); + if (failed && valid.length > 1) { + this.raise(state.start, FlowErrors.AmbiguousConditionalArrow); + } - if (this.eat(types.question)) { - optional = true; + if (failed && valid.length === 1) { + this.state = state; + this.state.noArrowAt = noArrowAt.concat(valid[0].start); + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + } } - typeAnnotation = this.flowParseTypeInitialiser(); - } else { - typeAnnotation = this.flowParseType(); + 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 + }; } - node.name = name; - node.optional = optional; - node.typeAnnotation = typeAnnotation; - return this.finishNode(node, "FunctionTypeParam"); - } + getArrowLikeExpressions(node, disallowInvalid) { + const stack = [node]; + const arrows = []; - 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"); - } + while (stack.length !== 0) { + const node = stack.pop(); - flowParseFunctionTypeParams(params = []) { - let rest = null; + if (node.type === "ArrowFunctionExpression") { + if (node.typeParameters || !node.returnType) { + this.finishArrowValidation(node); + } else { + arrows.push(node); + } - while (!this.match(types.parenR) && !this.match(types.ellipsis)) { - params.push(this.flowParseFunctionTypeParam()); + stack.push(node.body); + } else if (node.type === "ConditionalExpression") { + stack.push(node.consequent); + stack.push(node.alternate); + } + } - if (!this.match(types.parenR)) { - this.expect(types.comma); + if (disallowInvalid) { + arrows.forEach(node => this.finishArrowValidation(node)); + return [arrows, []]; } - } - if (this.eat(types.ellipsis)) { - rest = this.flowParseFunctionTypeParam(); + return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); } - return { - params, - rest - }; - } + 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(); + } - flowIdentToTypeAnnotation(startPos, startLoc, node, id) { - switch (id.name) { - case "any": - return this.finishNode(node, "AnyTypeAnnotation"); + forwardNoArrowParamsConversionAt(node, parse) { + let result; - case "bool": - case "boolean": - return this.finishNode(node, "BooleanTypeAnnotation"); + if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { + this.state.noArrowParamsConversionAt.push(this.state.start); + result = parse(); + this.state.noArrowParamsConversionAt.pop(); + } else { + result = parse(); + } - case "mixed": - return this.finishNode(node, "MixedTypeAnnotation"); + return result; + } - case "empty": - return this.finishNode(node, "EmptyTypeAnnotation"); + parseParenItem(node, startPos, startLoc) { + node = super.parseParenItem(node, startPos, startLoc); - case "number": - return this.finishNode(node, "NumberTypeAnnotation"); + if (this.eat(types.question)) { + node.optional = true; + this.resetEndLocation(node); + } - case "string": - return this.finishNode(node, "StringTypeAnnotation"); + if (this.match(types.colon)) { + const typeCastNode = this.startNodeAt(startPos, startLoc); + typeCastNode.expression = node; + typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TypeCastExpression"); + } - default: - this.checkNotUnderscore(id.name); - return this.flowParseGenericType(startPos, startLoc, id); + return node; } - } - 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; + 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; + } - switch (this.state.type) { - case types.name: - if (this.isContextual("interface")) { - return this.flowParseInterfaceType(); - } + super.assertModuleNodeAllowed(node); + } - return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); + parseExport(node) { + const decl = super.parseExport(node); - case types.braceL: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: true, - allowProto: false, - allowInexact: true - }); + if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") { + decl.exportKind = decl.exportKind || "value"; + } - case types.braceBarL: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: true, - allowSpread: true, - allowProto: false, - allowInexact: false - }); + return decl; + } - case types.bracketL: - this.state.noAnonFunctionType = false; - type = this.flowParseTupleType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - return type; + parseExportDeclaration(node) { + if (this.isContextual("type")) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); - 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; - this.expect(types.parenR); - this.expect(types.arrow); - node.returnType = this.flowParseType(); - return this.finishNode(node, "FunctionTypeAnnotation"); + 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); + } + } - break; + eatExportStar(node) { + if (super.eatExportStar(...arguments)) return true; - case types.parenL: + if (this.isContextual("type") && this.lookahead().type === types.star) { + node.exportKind = "type"; this.next(); + this.next(); + return true; + } - if (!this.match(types.parenR) && !this.match(types.ellipsis)) { - if (this.match(types.name)) { - const token = this.lookahead().type; - isGroupedType = token !== types.question && token !== types.colon; - } else { - isGroupedType = true; - } - } + return false; + } - if (isGroupedType) { - this.state.noAnonFunctionType = false; - type = this.flowParseType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; + maybeParseExportNamespaceSpecifier(node) { + const pos = this.state.start; + const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); - 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 (hasNamespace && node.exportKind === "type") { + this.unexpected(pos); + } - if (type) { - tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); - } else { - tmp = this.flowParseFunctionTypeParams(); - } + return hasNamespace; + } - node.params = tmp.params; - node.rest = tmp.rest; - this.expect(types.parenR); - this.expect(types.arrow); - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); + parseClassId(node, isStatement, optionalId) { + super.parseClassId(node, isStatement, optionalId); - case types.string: - return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + } - case types._true: - case types._false: - node.value = this.match(types._true); - this.next(); - return this.finishNode(node, "BooleanLiteralTypeAnnotation"); + parseClassMember(classBody, member, state) { + const pos = this.state.start; - case types.plusMin: - if (this.state.value === "-") { - this.next(); + if (this.isContextual("declare")) { + if (this.parseClassMemberFromModifier(classBody, member)) { + return; + } - if (this.match(types.num)) { - return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); - } + member.declare = true; + } - if (this.match(types.bigint)) { - return this.parseLiteral(-this.state.value, "BigIntLiteralTypeAnnotation", node.start, node.loc.start); - } + super.parseClassMember(classBody, member, state); - this.unexpected(null, `Unexpected token, expected "number" or "bigint"`); + if (member.declare) { + if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty") { + this.raise(pos, FlowErrors.DeclareClassElement); + } else if (member.value) { + this.raise(member.value.start, FlowErrors.DeclareClassFieldInitializer); } + } + } - this.unexpected(); + getTokenFromCode(code) { + const next = this.input.charCodeAt(this.state.pos + 1); - case types.num: - return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); + 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); + } + } - case types.bigint: - return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); + isAssignable(node, isBinding) { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + return true; - case types._void: - this.next(); - return this.finishNode(node, "VoidTypeAnnotation"); + 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 types._null: - this.next(); - return this.finishNode(node, "NullLiteralTypeAnnotation"); + case "ObjectProperty": + return this.isAssignable(node.value); - case types._this: - this.next(); - return this.finishNode(node, "ThisTypeAnnotation"); + case "SpreadElement": + return this.isAssignable(node.argument); - case types.star: - this.next(); - return this.finishNode(node, "ExistsTypeAnnotation"); + case "ArrayExpression": + return node.elements.every(element => this.isAssignable(element)); - 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); - } + case "AssignmentExpression": + return node.operator === "="; - } + case "ParenthesizedExpression": + case "TypeCastExpression": + return this.isAssignable(node.expression); - throw this.unexpected(); - } + case "MemberExpression": + case "OptionalMemberExpression": + return !isBinding; - flowParsePostfixType() { - const startPos = this.state.start, - startLoc = this.state.startLoc; - let type = this.flowParsePrimaryType(); + default: + return false; + } + } - 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"); + toAssignable(node, isLHS = false) { + if (node.type === "TypeCastExpression") { + return super.toAssignable(this.typeCastToParameter(node), isLHS); + } else { + return super.toAssignable(node, isLHS); + } } - return type; - } + toAssignableList(exprList, trailingCommaPos, isLHS) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; - flowParsePrefixType() { - const node = this.startNode(); + if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } + } - if (this.eat(types.question)) { - node.typeAnnotation = this.flowParsePrefixType(); - return this.finishNode(node, "NullableTypeAnnotation"); - } else { - return this.flowParsePostfixType(); + return super.toAssignableList(exprList, trailingCommaPos, isLHS); } - } - 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"); - } + toReferencedList(exprList, isParenthesizedExpr) { + for (let i = 0; i < exprList.length; i++) { + var _expr$extra; - return param; - } + const expr = exprList[i]; - flowParseIntersectionType() { - const node = this.startNode(); - this.eat(types.bitwiseAND); - const type = this.flowParseAnonFunctionWithoutParens(); - node.types = [type]; + 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); + } + } - while (this.eat(types.bitwiseAND)) { - node.types.push(this.flowParseAnonFunctionWithoutParens()); + return exprList; } - return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); - } + parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { + const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); - flowParseUnionType() { - const node = this.startNode(); - this.eat(types.bitwiseOR); - const type = this.flowParseIntersectionType(); - node.types = [type]; + if (canBePattern && !this.state.maybeInArrowParameters) { + this.toReferencedList(node.elements); + } - while (this.eat(types.bitwiseOR)) { - node.types.push(this.flowParseIntersectionType()); + return node; } - 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(); + checkLVal(expr, ...args) { + if (expr.type !== "TypeCastExpression") { + return super.checkLVal(expr, ...args); + } } - } - flowParseTypeAnnotation() { - const node = this.startNode(); - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "TypeAnnotation"); - } - - flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { - const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); + parseClassProperty(node) { + if (this.match(types.colon)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } - if (this.match(types.colon)) { - ident.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(ident); + return super.parseClassProperty(node); } - 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"; + parseClassPrivateProperty(node) { + if (this.match(types.colon)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); } - this.next(); - this.finishNode(variance, "Variance"); + return super.parseClassPrivateProperty(node); } - return variance; - } - - parseFunctionBody(node, allowExpressionBody, isMethod = false) { - if (allowExpressionBody) { - return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); + isClassMethod() { + return this.isRelational("<") || super.isClassMethod(); } - return super.parseFunctionBody(node, false, isMethod); - } + isClassProperty() { + return this.match(types.colon) || super.isClassProperty(); + } - 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; + isNonstaticConstructor(method) { + return !this.match(types.colon) && super.isNonstaticConstructor(method); } - super.parseFunctionBodyAndFinish(node, type, isMethod); - } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + if (method.variance) { + this.unexpected(method.variance.start); + } - parseStatement(context, topLevel) { - if (this.state.strict && this.match(types.name) && this.state.value === "interface") { - const node = this.startNode(); - this.next(); - return this.flowParseInterface(node); - } else { - const stmt = super.parseStatement(context, topLevel); + delete method.variance; - if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { - this.flowPragma = null; + if (this.isRelational("<")) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); } - return stmt; + super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); } - } - 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); - } + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + if (method.variance) { + this.unexpected(method.variance.start); } - } - return super.parseExpressionStatement(node, expr); - } + delete method.variance; - shouldParseExportDeclaration() { - return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || super.shouldParseExportDeclaration(); - } + if (this.isRelational("<")) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } - isExportDefaultSpecifier() { - if (this.match(types.name) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque")) { - return false; + super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); } - return super.isExportDefaultSpecifier(); - } - - parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) { - if (!this.match(types.question)) return expr; - - if (refNeedsArrowPos) { - const state = this.state.clone(); + parseClassSuper(node) { + super.parseClassSuper(node); - try { - return super.parseConditional(expr, noIn, startPos, startLoc); - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - refNeedsArrowPos.start = err.pos || this.state.start; - return expr; - } else { - throw err; - } + if (node.superClass && this.isRelational("<")) { + node.superTypeParameters = this.flowParseTypeParameterInstantiation(); } - } - - 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 (this.isContextual("implements")) { + this.next(); + const implemented = node.implements = []; - if (invalid.length > 0) { - this.state = state; - this.state.noArrowAt = noArrowAt; + do { + const node = this.startNode(); + node.id = this.flowParseRestrictedIdentifier(true); - for (let i = 0; i < invalid.length; i++) { - noArrowAt.push(invalid[i].start); - } + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - [valid, invalid] = this.getArrowLikeExpressions(consequent); + implemented.push(this.finishNode(node, "ClassImplements")); + } while (this.eat(types.comma)); } + } - if (failed && valid.length > 1) { - this.raise(state.start, "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate."); - } + parsePropertyName(node, isPrivateNameAllowed) { + const variance = this.flowParseVariance(); + const key = super.parsePropertyName(node, isPrivateNameAllowed); + node.variance = variance; + return key; + } - if (failed && valid.length === 1) { - this.state = state; - this.state.noArrowAt = noArrowAt.concat(valid[0].start); - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); + parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + if (prop.variance) { + this.unexpected(prop.variance.start); } - this.getArrowLikeExpressions(consequent, true); - } + delete prop.variance; + let typeParameters; - this.state.noArrowAt = originalNoArrowAt; - this.expect(types.colon); - node.test = expr; - node.consequent = consequent; - node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(noIn, undefined, undefined, undefined)); - return this.finishNode(node, "ConditionalExpression"); - } - - tryParseConditionalConsequent() { - this.state.noArrowParamsConversionAt.push(this.state.start); - const consequent = this.parseMaybeAssign(); - const failed = !this.match(types.colon); - this.state.noArrowParamsConversionAt.pop(); - return { - consequent, - failed - }; - } + if (this.isRelational("<") && !isAccessor) { + typeParameters = this.flowParseTypeParameterDeclaration(); + if (!this.match(types.parenL)) this.unexpected(); + } - getArrowLikeExpressions(node, disallowInvalid) { - const stack = [node]; - const arrows = []; + super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); - while (stack.length !== 0) { - const node = stack.pop(); + if (typeParameters) { + (prop.value || prop).typeParameters = typeParameters; + } + } - if (node.type === "ArrowFunctionExpression") { - if (node.typeParameters || !node.returnType) { - this.toAssignableList(node.params, true, "arrow function parameters"); - this.scope.enter(functionFlags(false, false) | SCOPE_ARROW); - super.checkParams(node, false, true); - this.scope.exit(); - } else { - arrows.push(node); + parseAssignableListItemTypes(param) { + if (this.eat(types.question)) { + if (param.type !== "Identifier") { + this.raise(param.start, FlowErrors.OptionalBindingPattern); } - stack.push(node.body); - } else if (node.type === "ConditionalExpression") { - stack.push(node.consequent); - stack.push(node.alternate); + param.optional = true; + } + + if (this.match(types.colon)) { + param.typeAnnotation = this.flowParseTypeAnnotation(); } + + this.resetEndLocation(param); + return param; } - if (disallowInvalid) { - for (let i = 0; i < arrows.length; i++) { - this.toAssignableList(node.params, true, "arrow function parameters"); + 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 [arrows, []]; + return node; } - return partition(arrows, node => { - try { - this.toAssignableList(node.params, true, "arrow function parameters"); - return true; - } catch (err) { - return false; + shouldParseDefaultImport(node) { + if (!hasTypeImportKind(node)) { + return super.shouldParseDefaultImport(node); } - }); - } - forwardNoArrowParamsConversionAt(node, parse) { - let result; + return isMaybeDefaultImport(this.state); + } - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - this.state.noArrowParamsConversionAt.push(this.state.start); - result = parse(); - this.state.noArrowParamsConversionAt.pop(); - } else { - result = parse(); + 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)); } - return result; - } + maybeParseDefaultImportSpecifier(node) { + node.importKind = "value"; + let kind = null; - parseParenItem(node, startPos, startLoc) { - node = super.parseParenItem(node, startPos, startLoc); + if (this.match(types._typeof)) { + kind = "typeof"; + } else if (this.isContextual("type")) { + kind = "type"; + } - if (this.eat(types.question)) { - node.optional = true; - this.resetEndLocation(node); - } + if (kind) { + const lh = this.lookahead(); - if (this.match(types.colon)) { - const typeCastNode = this.startNodeAt(startPos, startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TypeCastExpression"); - } + if (kind === "type" && lh.type === types.star) { + this.unexpected(lh.start); + } - return node; - } + if (isMaybeDefaultImport(lh) || lh.type === types.braceL || lh.type === types.star) { + this.next(); + node.importKind = kind; + } + } - 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; + return super.maybeParseDefaultImportSpecifier(node); } - super.assertModuleNodeAllowed(node); - } + parseImportSpecifier(node) { + const specifier = this.startNode(); + const firstIdentLoc = this.state.start; + const firstIdent = this.parseModuleExportName(); + let specifierTypeKind = null; - parseExport(node) { - const decl = super.parseExport(node); + if (firstIdent.type === "Identifier") { + if (firstIdent.name === "type") { + specifierTypeKind = "type"; + } else if (firstIdent.name === "typeof") { + specifierTypeKind = "typeof"; + } + } - if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") { - decl.exportKind = decl.exportKind || "value"; - } + let isBinding = false; - return decl; - } + if (this.isContextual("as") && !this.isLookaheadContextual("as")) { + const as_ident = this.parseIdentifier(true); - parseExportDeclaration(node) { - if (this.isContextual("type")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); + 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.match(types.braceL)) { - node.specifiers = this.parseExportSpecifiers(); - this.parseExportFrom(node); - return null; + if (this.eatContextual("as")) { + specifier.local = this.parseIdentifier(); + } else { + isBinding = true; + specifier.local = specifier.imported.__clone(); + } } else { - return this.flowParseTypeAlias(declarationNode); + 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(); } - } 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 { - return super.parseExportDeclaration(node); - } - } - eatExportStar(node) { - if (super.eatExportStar(...arguments)) return true; + const nodeIsTypeImport = hasTypeImportKind(node); + const specifierIsTypeImport = hasTypeImportKind(specifier); - if (this.isContextual("type") && this.lookahead().type === types.star) { - node.exportKind = "type"; - this.next(); - this.next(); - return true; - } + if (nodeIsTypeImport && specifierIsTypeImport) { + this.raise(firstIdentLoc, FlowErrors.ImportTypeShorthandOnlyInPureImport); + } - return false; - } + if (nodeIsTypeImport || specifierIsTypeImport) { + this.checkReservedType(specifier.local.name, specifier.local.start, true); + } - maybeParseExportNamespaceSpecifier(node) { - const pos = this.state.start; - const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); + if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) { + this.checkReservedWord(specifier.local.name, specifier.start, true, true); + } - if (hasNamespace && node.exportKind === "type") { - this.unexpected(pos); + this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL); + node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); } - return hasNamespace; - } + parseFunctionParams(node, allowModifiers) { + const kind = node.kind; - parseClassId(node, isStatement, optionalId) { - super.parseClassId(node, isStatement, optionalId); + if (kind !== "get" && kind !== "set" && this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); + super.parseFunctionParams(node, allowModifiers); } - } - getTokenFromCode(code) { - const next = this.input.charCodeAt(this.state.pos + 1); + parseVarId(decl, kind) { + super.parseVarId(decl, kind); - 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 (isIteratorStart(code, next)) { - this.state.isIterator = true; - return super.readWord(); - } else { - return super.getTokenFromCode(code); + if (this.match(types.colon)) { + decl.id.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(decl.id); + } } - } - toAssignable(node, isBinding, contextDescription) { - if (node.type === "TypeCastExpression") { - return super.toAssignable(this.typeCastToParameter(node), isBinding, contextDescription); - } else { - return super.toAssignable(node, isBinding, contextDescription); - } - } + 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; + } - toAssignableList(exprList, isBinding, contextDescription) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; + return super.parseAsyncArrowFromCallExpression(node, call); + } - if (expr && expr.type === "TypeCastExpression") { - exprList[i] = this.typeCastToParameter(expr); - } + shouldParseAsyncArrow() { + return this.match(types.colon) || super.shouldParseAsyncArrow(); } - return super.toAssignableList(exprList, isBinding, contextDescription); - } + parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos) { + var _jsx; - toReferencedList(exprList, isParenthesizedExpr) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; + let state = null; + let jsx; - if (expr && expr.type === "TypeCastExpression" && (!expr.extra || !expr.extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { - this.raise(expr.typeAnnotation.start, "The type cast expression is expected to be wrapped with parenthesis"); - } - } + 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; - return exprList; - } + 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; + } + } - checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) { - if (expr.type !== "TypeCastExpression") { - return super.checkLVal(expr, bindingType, checkClashes, contextDescription); - } - } + if (((_jsx = jsx) == null ? void 0 : _jsx.error) || this.isRelational("<")) { + var _jsx2, _jsx3; - parseClassProperty(node) { - if (this.match(types.colon)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } + state = state || this.state.clone(); + let typeParameters; + const arrow = this.tryParse(abort => { + var _arrowExpression$extr; - return super.parseClassProperty(node); - } + typeParameters = this.flowParseTypeParameterDeclaration(); + const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { + const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos); + this.resetStartLocationFromNode(result, typeParameters); + return result; + }); - parseClassPrivateProperty(node) { - if (this.match(types.colon)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } + if (arrowExpression.type !== "ArrowFunctionExpression" && ((_arrowExpression$extr = arrowExpression.extra) == null ? void 0 : _arrowExpression$extr.parenthesized)) { + abort(); + } - return super.parseClassPrivateProperty(node); - } + 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); + } - isClassMethod() { - return this.isRelational("<") || super.isClassMethod(); - } + return arrow.node; + } - isClassProperty() { - return this.match(types.colon) || super.isClassProperty(); - } + arrowExpression = arrow.node; + } - isNonstaticConstructor(method) { - return !this.match(types.colon) && super.isNonstaticConstructor(method); - } + if ((_jsx2 = jsx) == null ? void 0 : _jsx2.node) { + this.state = jsx.failState; + return jsx.node; + } - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - if (method.variance) { - this.unexpected(method.variance.start); - } + if (arrowExpression) { + this.state = arrow.failState; + return arrowExpression; + } - delete method.variance; + if ((_jsx3 = jsx) == null ? void 0 : _jsx3.thrown) throw jsx.error; + if (arrow.thrown) throw arrow.error; + throw this.raise(typeParameters.start, FlowErrors.UnexpectedTokenAfterTypeParameter); + } - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); + return super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos); } - super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); - } + 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; + } - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - if (method.variance) { - this.unexpected(method.variance.start); + return super.parseArrow(node); } - delete method.variance; - - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); + shouldParseArrow() { + return this.match(types.colon) || super.shouldParseArrow(); } - super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); - } + setArrowFunctionParameters(node, params) { + if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { + node.params = params; + } else { + super.setArrowFunctionParameters(node, params); + } + } - parseClassSuper(node) { - super.parseClassSuper(node); + checkParams(node, allowDuplicates, isArrowFunction) { + if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { + return; + } - if (node.superClass && this.isRelational("<")) { - node.superTypeParameters = this.flowParseTypeParameterInstantiation(); + return super.checkParams(...arguments); } - if (this.isContextual("implements")) { - this.next(); - const implemented = node.implements = []; + parseParenAndDistinguishExpression(canBeArrow) { + return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1); + } - do { - const node = this.startNode(); - node.id = this.flowParseRestrictedIdentifier(true); + 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 (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; + if (arrow.node) { + this.state = arrow.failState; + return arrow.node; } - implemented.push(this.finishNode(node, "ClassImplements")); - } while (this.eat(types.comma)); - } - } + if (result.node) { + this.state = result.failState; + return result.node; + } - parsePropertyName(node) { - const variance = this.flowParseVariance(); - const key = super.parsePropertyName(node); - node.variance = variance; - return key; - } + throw arrow.error || result.error; + } - parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc) { - if (prop.variance) { - this.unexpected(prop.variance.start); + return super.parseSubscripts(base, startPos, startLoc, noCalls); } - delete prop.variance; - let typeParameters; + parseSubscript(base, startPos, startLoc, noCalls, subscriptState) { + if (this.match(types.questionDot) && this.isLookaheadToken_lt()) { + subscriptState.optionalChainMember = true; - if (this.isRelational("<")) { - typeParameters = this.flowParseTypeParameterDeclaration(); - if (!this.match(types.parenL)) this.unexpected(); - } + if (noCalls) { + subscriptState.stop = true; + return base; + } - super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc); + 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; + } + } - if (typeParameters) { - (prop.value || prop).typeParameters = typeParameters; + return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState); } - } - parseAssignableListItemTypes(param) { - if (this.eat(types.question)) { - if (param.type !== "Identifier") { - throw this.raise(param.start, "A binding pattern parameter cannot be optional in an implementation signature."); + parseNewArguments(node) { + let targs = null; + + if (this.shouldParseTypes() && this.isRelational("<")) { + targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; } - param.optional = true; + node.typeArguments = targs; + super.parseNewArguments(node); } - if (this.match(types.colon)) { - param.typeAnnotation = this.flowParseTypeAnnotation(); + parseAsyncArrowWithTypeParameters(startPos, startLoc) { + const node = this.startNodeAt(startPos, startLoc); + this.parseFunctionParams(node); + if (!this.parseArrow(node)) return; + return this.parseArrowExpression(node, undefined, true); } - this.resetEndLocation(param); - return param; - } + readToken_mult_modulo(code) { + const next = this.input.charCodeAt(this.state.pos + 1); - parseMaybeDefault(startPos, startLoc, left) { - const node = super.parseMaybeDefault(startPos, startLoc, left); + if (code === 42 && next === 47 && this.state.hasFlowComment) { + this.state.hasFlowComment = false; + this.state.pos += 2; + this.nextToken(); + return; + } - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, " + "e.g. instead of `age = 25: number` use `age: number = 25`"); + super.readToken_mult_modulo(code); } - return node; - } + readToken_pipe_amp(code) { + const next = this.input.charCodeAt(this.state.pos + 1); - shouldParseDefaultImport(node) { - if (!hasTypeImportKind(node)) { - return super.shouldParseDefaultImport(node); - } + if (code === 124 && next === 125) { + this.finishOp(types.braceBarR, 2); + return; + } - return isMaybeDefaultImport(this.state); - } + super.readToken_pipe_amp(code); + } - parseImportSpecifierLocal(node, specifier, type, contextDescription) { - specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true) : this.parseIdentifier(); - this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription); - node.specifiers.push(this.finishNode(specifier, type)); - } + parseTopLevel(file, program) { + const fileNode = super.parseTopLevel(file, program); - maybeParseDefaultImportSpecifier(node) { - node.importKind = "value"; - let kind = null; + if (this.state.hasFlowComment) { + this.raise(this.state.pos, FlowErrors.UnterminatedFlowComment); + } - if (this.match(types._typeof)) { - kind = "typeof"; - } else if (this.isContextual("type")) { - kind = "type"; + return fileNode; } - if (kind) { - const lh = this.lookahead(); + skipBlockComment() { + if (this.hasPlugin("flowComments") && this.skipFlowComment()) { + if (this.state.hasFlowComment) { + this.unexpected(null, FlowErrors.NestedFlowComment); + } - if (kind === "type" && lh.type === types.star) { - this.unexpected(lh.start); + this.hasFlowCommentCompletion(); + this.state.pos += this.skipFlowComment(); + this.state.hasFlowComment = true; + return; } - if (isMaybeDefaultImport(lh) || lh.type === types.braceL || lh.type === types.star) { - this.next(); - node.importKind = kind; - } - } + if (this.state.hasFlowComment) { + const end = this.input.indexOf("*-/", this.state.pos += 2); - return super.maybeParseDefaultImportSpecifier(node); - } + if (end === -1) { + throw this.raise(this.state.pos - 2, ErrorMessages.UnterminatedComment); + } - parseImportSpecifier(node) { - const specifier = this.startNode(); - const firstIdentLoc = this.state.start; - const firstIdent = this.parseIdentifier(true); - let specifierTypeKind = null; + this.state.pos = end + 3; + return; + } - if (firstIdent.name === "type") { - specifierTypeKind = "type"; - } else if (firstIdent.name === "typeof") { - specifierTypeKind = "typeof"; + super.skipBlockComment(); } - let isBinding = false; + skipFlowComment() { + const { + pos + } = this.state; + let shiftToFirstNonWhiteSpace = 2; + + while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { + shiftToFirstNonWhiteSpace++; + } - if (this.isContextual("as") && !this.isLookaheadContextual("as")) { - const as_ident = this.parseIdentifier(true); + const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); + const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); - 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(); + if (ch2 === 58 && ch3 === 58) { + return shiftToFirstNonWhiteSpace + 2; } - } 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(); + if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { + return shiftToFirstNonWhiteSpace + 12; } - } else { - isBinding = true; - specifier.imported = firstIdent; - specifier.importKind = null; - specifier.local = specifier.imported.__clone(); + + if (ch2 === 58 && ch3 !== 58) { + return shiftToFirstNonWhiteSpace; + } + + return false; } - const nodeIsTypeImport = hasTypeImportKind(node); - const specifierIsTypeImport = hasTypeImportKind(specifier); + hasFlowCommentCompletion() { + const end = this.input.indexOf("*/", this.state.pos); - if (nodeIsTypeImport && specifierIsTypeImport) { - this.raise(firstIdentLoc, "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"); + if (end === -1) { + throw this.raise(this.state.pos, ErrorMessages.UnterminatedComment); + } } - if (nodeIsTypeImport || specifierIsTypeImport) { - this.checkReservedType(specifier.local.name, specifier.local.start); + flowEnumErrorBooleanMemberNotInitialized(pos, { + enumName, + memberName + }) { + this.raise(pos, FlowErrors.EnumBooleanMemberNotInitialized, memberName, enumName); } - if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) { - this.checkReservedWord(specifier.local.name, specifier.start, true, true); + flowEnumErrorInvalidMemberName(pos, { + enumName, + memberName + }) { + const suggestion = memberName[0].toUpperCase() + memberName.slice(1); + this.raise(pos, FlowErrors.EnumInvalidMemberName, memberName, suggestion, enumName); } - this.checkLVal(specifier.local, BIND_LEXICAL, undefined, "import specifier"); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); - } + flowEnumErrorDuplicateMemberName(pos, { + enumName, + memberName + }) { + this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName); + } - parseFunctionParams(node, allowModifiers) { - const kind = node.kind; + flowEnumErrorInconsistentMemberValues(pos, { + enumName + }) { + this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName); + } - if (kind !== "get" && kind !== "set" && this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); + flowEnumErrorInvalidExplicitType(pos, { + enumName, + suppliedType + }) { + return this.raise(pos, suppliedType === null ? FlowErrors.EnumInvalidExplicitTypeUnknownSupplied : FlowErrors.EnumInvalidExplicitType, enumName, suppliedType); } - super.parseFunctionParams(node, allowModifiers); - } + flowEnumErrorInvalidMemberInitializer(pos, { + enumName, + explicitType, + memberName + }) { + let message = null; - parseVarId(decl, kind) { - super.parseVarId(decl, kind); + switch (explicitType) { + case "boolean": + case "number": + case "string": + message = FlowErrors.EnumInvalidMemberInitializerPrimaryType; + break; - if (this.match(types.colon)) { - decl.id.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(decl.id); - } - } + case "symbol": + message = FlowErrors.EnumInvalidMemberInitializerSymbolType; + break; - 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; + default: + message = FlowErrors.EnumInvalidMemberInitializerUnknownType; + } + + return this.raise(pos, message, enumName, memberName, explicitType); } - return super.parseAsyncArrowFromCallExpression(node, call); - } + flowEnumErrorNumberMemberNotInitialized(pos, { + enumName, + memberName + }) { + this.raise(pos, FlowErrors.EnumNumberMemberNotInitialized, enumName, memberName); + } - shouldParseAsyncArrow() { - return this.match(types.colon) || super.shouldParseAsyncArrow(); - } + flowEnumErrorStringMemberInconsistentlyInitailized(pos, { + enumName + }) { + this.raise(pos, FlowErrors.EnumStringMemberInconsistentlyInitailized, enumName); + } - parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) { - let jsxError = null; + flowEnumMemberInit() { + const startPos = this.state.start; - if (this.hasPlugin("jsx") && (this.match(types.jsxTagStart) || this.isRelational("<"))) { - const state = this.state.clone(); + const endOfInit = () => this.match(types.comma) || this.match(types.braceR); - try { - return super.parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos); - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - const cLength = this.state.context.length; + 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 + }; + } - if (this.state.context[cLength - 1] === types$1.j_oTag) { - this.state.context.length -= 2; + return { + type: "invalid", + pos: startPos + }; } - jsxError = err; - } else { - throw err; - } - } - } + case types.string: + { + const literal = this.parseLiteral(this.state.value, "StringLiteral"); + + if (endOfInit()) { + return { + type: "string", + pos: literal.start, + value: literal + }; + } - if (jsxError != null || this.isRelational("<")) { - let arrowExpression; - let typeParameters; + return { + type: "invalid", + pos: startPos + }; + } - try { - typeParameters = this.flowParseTypeParameterDeclaration(); - arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => super.parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos)); - arrowExpression.typeParameters = typeParameters; - this.resetStartLocationFromNode(arrowExpression, typeParameters); - } catch (err) { - throw jsxError || err; - } + case types._true: + case types._false: + { + const literal = this.parseBooleanLiteral(); + + if (endOfInit()) { + return { + type: "boolean", + pos: literal.start, + value: literal + }; + } - if (arrowExpression.type === "ArrowFunctionExpression") { - return arrowExpression; - } else if (jsxError != null) { - throw jsxError; - } else { - this.raise(typeParameters.start, "Expected an arrow function after this type parameter declaration"); + return { + type: "invalid", + pos: startPos + }; + } + + default: + return { + type: "invalid", + pos: startPos + }; } } - return super.parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos); - } - - parseArrow(node) { - if (this.match(types.colon)) { - const state = this.state.clone(); - - try { - 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(); - node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - } else { - throw err; - } - } + 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 + }; } - return super.parseArrow(node); - } + flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) { + const { + explicitType + } = context; - shouldParseArrow() { - return this.match(types.colon) || super.shouldParseArrow(); - } + if (explicitType === null) { + return; + } - setArrowFunctionParameters(node, params) { - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - node.params = params; - } else { - super.setArrowFunctionParameters(node, params); + if (explicitType !== expectedType) { + this.flowEnumErrorInvalidMemberInitializer(pos, context); + } } - } - checkParams(node, allowDuplicates, isArrowFunction) { - if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - return; - } + flowEnumMembers({ + enumName, + explicitType + }) { + const seenNames = new Set(); + const members = { + booleanMembers: [], + numberMembers: [], + stringMembers: [], + defaultedMembers: [] + }; - return super.checkParams(node, allowDuplicates, isArrowFunction); - } + while (!this.match(types.braceR)) { + const memberNode = this.startNode(); + const { + id, + init + } = this.flowEnumMemberRaw(); + const memberName = id.name; - parseParenAndDistinguishExpression(canBeArrow) { - return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1); - } + if (memberName === "") { + continue; + } - 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(); - let error; + if (/^[a-z]/.test(memberName)) { + this.flowEnumErrorInvalidMemberName(id.start, { + enumName, + memberName + }); + } - try { - const node = this.parseAsyncArrowWithTypeParameters(startPos, startLoc); - if (node) return node; - } catch (e) { - error = e; - } + if (seenNames.has(memberName)) { + this.flowEnumErrorDuplicateMemberName(id.start, { + enumName, + memberName + }); + } - this.state = state; + seenNames.add(memberName); + const context = { + enumName, + explicitType, + memberName + }; + memberNode.id = id; - try { - return super.parseSubscripts(base, startPos, startLoc, noCalls); - } catch (e) { - throw error || e; - } - } + switch (init.type) { + case "boolean": + { + this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "boolean"); + memberNode.init = init.value; + members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); + break; + } - return super.parseSubscripts(base, startPos, startLoc, noCalls); - } + case "number": + { + this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number"); + memberNode.init = init.value; + members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); + break; + } - parseSubscript(base, startPos, startLoc, noCalls, subscriptState, maybeAsyncArrow) { - if (this.match(types.questionDot) && this.isLookaheadRelational("<")) { - this.expectPlugin("optionalChaining"); - subscriptState.optionalChainMember = true; + case "string": + { + this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string"); + memberNode.init = init.value; + members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); + break; + } - if (noCalls) { - subscriptState.stop = true; - return base; - } + case "invalid": + { + throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context); + } - 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.finishNode(node, "OptionalCallExpression"); - } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) { - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - const state = this.state.clone(); + case "none": + { + switch (explicitType) { + case "boolean": + this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context); + break; - try { - node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); - this.expect(types.parenL); - node.arguments = this.parseCallExpressionArguments(types.parenR, false); + case "number": + this.flowEnumErrorNumberMemberNotInitialized(init.pos, context); + break; - if (subscriptState.optionalChainMember) { - node.optional = false; - return this.finishNode(node, "OptionalCallExpression"); + default: + members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); + } + } } - return this.finishNode(node, "CallExpression"); - } catch (e) { - if (e instanceof SyntaxError) { - this.state = state; - } else { - throw e; + if (!this.match(types.braceR)) { + this.expect(types.comma); } } - } - - return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState, maybeAsyncArrow); - } - parseNewArguments(node) { - let targs = null; + return members; + } - if (this.shouldParseTypes() && this.isRelational("<")) { - const state = this.state.clone(); + 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 + }); + } - try { - targs = this.flowParseTypeParameterInstantiationCallOrNew(); - } catch (e) { - if (e instanceof SyntaxError) { - this.state = state; - } else { - throw e; + return defaultedMembers; + } else { + for (let _i2 = 0; _i2 < defaultedMembers.length; _i2++) { + const member = defaultedMembers[_i2]; + this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, { + enumName + }); } + + return initializedMembers; } } - 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); + flowEnumParseExplicitType({ + enumName + }) { + if (this.eatContextual("of")) { + if (!this.match(types.name)) { + throw this.flowEnumErrorInvalidExplicitType(this.state.start, { + enumName, + suppliedType: null + }); + } - if (code === 42 && next === 47 && this.state.hasFlowComment) { - this.state.hasFlowComment = false; - this.state.pos += 2; - this.nextToken(); - return; - } + const { + value + } = this.state; + this.next(); - super.readToken_mult_modulo(code); - } + if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { + this.flowEnumErrorInvalidExplicitType(this.state.start, { + enumName, + suppliedType: value + }); + } - readToken_pipe_amp(code) { - const next = this.input.charCodeAt(this.state.pos + 1); + return value; + } - if (code === 124 && next === 125) { - this.finishOp(types.braceBarR, 2); - return; + return null; } - super.readToken_pipe_amp(code); - } + flowEnumBody(node, { + enumName, + nameLoc + }) { + const explicitType = this.flowEnumParseExplicitType({ + enumName + }); + this.expect(types.braceL); + const members = this.flowEnumMembers({ + enumName, + explicitType + }); - parseTopLevel(file, program) { - const fileNode = super.parseTopLevel(file, program); + 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"); - if (this.state.hasFlowComment) { - this.unexpected(null, "Unterminated flow-comment"); - } + 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 + }); + } - return fileNode; - } + 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 + }); + } - skipBlockComment() { - if (this.hasPlugin("flowComments") && this.skipFlowComment()) { - if (this.state.hasFlowComment) { - this.unexpected(null, "Cannot have a flow comment inside another flow comment"); + node.members = members.numberMembers; + this.expect(types.braceR); + return this.finishNode(node, "EnumNumberBody"); + } else { + this.flowEnumErrorInconsistentMemberValues(nameLoc, { + enumName + }); + return empty(); + } + } } - - 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) this.raise(this.state.pos - 2, "Unterminated comment"); - this.state.pos = end + 3; - return; + 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"); } - super.skipBlockComment(); - } - - skipFlowComment() { - const { - pos - } = this.state; - let shiftToFirstNonWhiteSpace = 2; - - while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { - shiftToFirstNonWhiteSpace++; + 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); + } } - const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); - const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); - - if (ch2 === 58 && ch3 === 58) { - return shiftToFirstNonWhiteSpace + 2; - } + isLookaheadToken_lt() { + const next = this.nextTokenStart(); - if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { - return shiftToFirstNonWhiteSpace + 12; - } + if (this.input.charCodeAt(next) === 60) { + const afterNext = this.input.charCodeAt(next + 1); + return afterNext !== 60 && afterNext !== 61; + } - if (ch2 === 58 && ch3 !== 58) { - return shiftToFirstNonWhiteSpace; + return false; } - return false; - } - - hasFlowCommentCompletion() { - const end = this.input.indexOf("*/", this.state.pos); - - if (end === -1) { - this.raise(this.state.pos, "Unterminated comment"); + maybeUnwrapTypeCastExpression(node) { + return node.type === "TypeCastExpression" ? node.expression : node; } - } + }, _temp; }); const entities = { @@ -3173,6 +4319,14 @@ const entities = { 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>", + 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); @@ -3229,7 +4383,7 @@ var jsx = (superClass => class extends superClass { for (;;) { if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated JSX contents"); + throw this.raise(this.state.start, JsxErrors.UnterminatedJsxContent); } const ch = this.input.charCodeAt(this.state.pos); @@ -3291,7 +4445,7 @@ var jsx = (superClass => class extends superClass { for (;;) { if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated string constant"); + throw this.raise(this.state.start, ErrorMessages.UnterminatedString); } const ch = this.input.charCodeAt(this.state.pos); @@ -3399,6 +4553,10 @@ var jsx = (superClass => class extends superClass { 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; @@ -3419,17 +4577,17 @@ var jsx = (superClass => class extends superClass { node = this.jsxParseExpressionContainer(node); if (node.expression.type === "JSXEmptyExpression") { - throw this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); - } else { - return node; + this.raise(node.start, JsxErrors.AttributeIsEmpty); } + return node; + case types.jsxTagStart: case types.string: return this.parseExprAtom(); default: - throw this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); + throw this.raise(this.state.start, JsxErrors.UnsupportedJsxValue); } } @@ -3461,7 +4619,7 @@ var jsx = (superClass => class extends superClass { if (this.eat(types.braceL)) { this.expect(types.ellipsis); - node.argument = this.parseMaybeAssign(); + node.argument = this.parseMaybeAssignAllowIn(); this.expect(types.braceR); return this.finishNode(node, "JSXSpreadAttribute"); } @@ -3555,12 +4713,12 @@ var jsx = (superClass => class extends superClass { } if (isFragment(openingElement) && !isFragment(closingElement)) { - this.raise(closingElement.start, "Expected corresponding JSX closing tag for <>"); + this.raise(closingElement.start, JsxErrors.MissingClosingTagFragment); } else if (!isFragment(openingElement) && isFragment(closingElement)) { - this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">"); + 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, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">"); + this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name)); } } } @@ -3575,8 +4733,8 @@ var jsx = (superClass => class extends superClass { node.children = children; - if (this.match(types.relational) && this.state.value === "<") { - this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag. " + "Did you want a JSX fragment <>...?"); + if (this.isRelational("<")) { + throw this.raise(this.state.start, JsxErrors.UnwrappedAdjacentJSXElements); } return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); @@ -3589,7 +4747,7 @@ var jsx = (superClass => class extends superClass { return this.jsxParseElementAt(startPos, startLoc); } - parseExprAtom(refShortHandDefaultPos) { + parseExprAtom(refExpressionErrors) { if (this.match(types.jsxText)) { return this.parseLiteral(this.state.value, "JSXText"); } else if (this.match(types.jsxTagStart)) { @@ -3598,7 +4756,7 @@ var jsx = (superClass => class extends superClass { this.finishToken(types.jsxTagStart); return this.jsxParseElement(); } else { - return super.parseExprAtom(refShortHandDefaultPos); + return super.parseExprAtom(refExpressionErrors); } } @@ -3659,6 +4817,7 @@ var jsx = (superClass => class extends superClass { class Scope { constructor(flags) { + this.flags = void 0; this.var = []; this.lexical = []; this.functions = []; @@ -3670,6 +4829,7 @@ class ScopeHandler { constructor(raise, inModule) { this.scopeStack = []; this.undefinedExports = new Map(); + this.undefinedPrivateNames = new Map(); this.raise = raise; this.inModule = inModule; } @@ -3678,14 +4838,6 @@ class ScopeHandler { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0; } - get inGenerator() { - return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0; - } - - get inAsync() { - return (this.currentVarScope().flags & SCOPE_ASYNC) > 0; - } - get allowSuper() { return (this.currentThisScope().flags & SCOPE_SUPER) > 0; } @@ -3694,6 +4846,10 @@ class ScopeHandler { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0; } + get inClass() { + return (this.currentThisScope().flags & SCOPE_CLASS) > 0; + } + get inNonArrowFunction() { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0; } @@ -3756,7 +4912,7 @@ class ScopeHandler { checkRedeclarationInScope(scope, name, bindingType, pos) { if (this.isRedeclaredInScope(scope, name, bindingType)) { - this.raise(pos, `Identifier '${name}' has already been declared`); + this.raise(pos, ErrorMessages.VarRedeclaration, name); } } @@ -3874,13 +5030,56 @@ class TypeScriptScopeHandler extends ScopeHandler { 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); - } + 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) { @@ -3896,6 +5095,36 @@ function assert(x) { } } +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'", + EmptyHeritageClauseType: "'%0' list cannot be empty.", + EmptyTypeArguments: "Type argument list cannot be empty.", + EmptyTypeParameters: "Type parameter list cannot be empty.", + 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", + InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", + MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.", + 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')", + 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": @@ -3944,7 +5173,7 @@ var typescript = (superClass => class extends superClass { tsNextTokenCanFollowModifier() { this.next(); - return !this.hasPrecedingLineBreak() && !this.match(types.parenL) && !this.match(types.parenR) && !this.match(types.colon) && !this.match(types.eq) && !this.match(types.question) && !this.match(types.bang); + 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) { @@ -3961,6 +5190,20 @@ var typescript = (superClass => class extends superClass { return undefined; } + tsParseModifiers(modified, allowedModifiers) { + for (;;) { + const startPos = this.state.start; + const modifier = this.tsParseModifier(allowedModifiers); + if (!modifier) break; + + if (Object.hasOwnProperty.call(modified, modifier)) { + this.raise(startPos, TSErrors.DuplicateModifier, modifier); + } + + modified[modifier] = true; + } + } + tsIsListTerminator(kind) { switch (kind) { case "EnumMembers": @@ -3997,7 +5240,7 @@ var typescript = (superClass => class extends superClass { tsParseDelimitedListWorker(kind, parseElement, expectSuccess) { const result = []; - while (true) { + for (;;) { if (this.tsIsListTerminator(kind)) { break; } @@ -4054,7 +5297,7 @@ var typescript = (superClass => class extends superClass { this.expect(types.parenL); if (!this.match(types.string)) { - throw this.unexpected(null, "Argument in a type import must be a string literal"); + this.raise(this.state.start, TSErrors.UnsupportedImportTypeArgument); } node.argument = this.parseExprAtom(); @@ -4100,6 +5343,7 @@ var typescript = (superClass => class extends superClass { const node = this.startNodeAtNode(lhs); node.parameterName = lhs; node.typeAnnotation = this.tsParseTypeAnnotation(false); + node.asserts = false; return this.finishNode(node, "TSTypePredicate"); } @@ -4146,6 +5390,11 @@ var typescript = (superClass => class extends superClass { } 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"); } @@ -4172,9 +5421,9 @@ var typescript = (superClass => class extends superClass { } tsParseBindingListForSignature() { - return this.parseBindingList(types.parenR).map(pattern => { + return this.parseBindingList(types.parenR, 41).map(pattern => { if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") { - throw this.unexpected(pattern.start, `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${pattern.type}`); + this.raise(pattern.start, TSErrors.UnsupportedSignatureParameterKind, pattern.type); } return pattern; @@ -4261,7 +5510,7 @@ var typescript = (superClass => class extends superClass { return idx; } - this.parsePropertyName(node); + this.parsePropertyName(node, false); return this.tsParsePropertyOrMethodSignature(node, readonly); } @@ -4324,6 +5573,7 @@ var typescript = (superClass => class extends superClass { 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)) { @@ -4344,31 +5594,68 @@ var typescript = (superClass => class extends superClass { 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 => { - if (elementNode.type === "TSOptionalType") { - seenOptionalElement = true; - } else if (seenOptionalElement && elementNode.type !== "TSRestType") { - this.raise(elementNode.start, "A required element cannot follow an optional element."); + 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() { - if (this.match(types.ellipsis)) { - const restNode = this.startNode(); - this.next(); - restNode.typeAnnotation = this.tsParseType(); - this.checkCommaAfterRest(); - return this.finishNode(restNode, "TSRestType"); - } + 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); - const type = this.tsParseType(); + if (labeled) { + const labeledNode = this.startNodeAtNode(type); + labeledNode.optional = optional; - if (this.eat(types.question)) { + 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; - return this.finishNode(optionalTypeNode, "TSOptionalType"); + type = this.finishNode(optionalTypeNode, "TSOptionalType"); + } + + if (rest) { + const restNode = this.startNodeAt(startPos, startLoc); + restNode.typeAnnotation = type; + type = this.finishNode(restNode, "TSRestType"); } return type; @@ -4399,6 +5686,7 @@ var typescript = (superClass => class extends superClass { node.literal = (() => { switch (this.state.type) { case types.num: + case types.bigint: case types.string: case types._true: case types._false: @@ -4414,14 +5702,23 @@ var typescript = (superClass => class extends superClass { tsParseTemplateLiteralType() { const node = this.startNode(); - const templateNode = this.parseTemplate(false); + node.literal = this.parseTemplate(false); + return this.finishNode(node, "TSLiteralType"); + } - if (templateNode.expressions.length > 0) { - throw this.raise(templateNode.expressions[0].start, "Template literal types cannot have any substitution"); - } + parseTemplateSubstitution() { + if (this.state.inType) return this.tsParseType(); + return super.parseTemplateSubstitution(); + } - node.literal = templateNode; - return this.finishNode(node, "TSLiteralType"); + tsParseThisTypeOrThisTypePredicate() { + const thisKeyword = this.tsParseThisTypeNode(); + + if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { + return this.tsParseThisTypePredicate(thisKeyword); + } else { + return thisKeyword; + } } tsParseNonArrayType() { @@ -4432,7 +5729,7 @@ var typescript = (superClass => class extends superClass { { const type = this.match(types._void) ? "TSVoidKeyword" : this.match(types._null) ? "TSNullKeyword" : keywordTypeFromName(this.state.value); - if (type !== undefined && this.lookahead().type !== types.dot) { + if (type !== undefined && this.lookaheadCharCode() !== 46) { const node = this.startNode(); this.next(); return this.finishNode(node, type); @@ -4443,6 +5740,7 @@ var typescript = (superClass => class extends superClass { case types.string: case types.num: + case types.bigint: case types._true: case types._false: return this.tsParseLiteralTypeNode(); @@ -4450,8 +5748,9 @@ var typescript = (superClass => class extends superClass { case types.plusMin: if (this.state.value === "-") { const node = this.startNode(); + const nextToken = this.lookahead(); - if (this.lookahead().type !== types.num) { + if (nextToken.type !== types.num && nextToken.type !== types.bigint) { throw this.unexpected(); } @@ -4462,15 +5761,7 @@ var typescript = (superClass => class extends superClass { break; case types._this: - { - const thisKeyword = this.tsParseThisTypeNode(); - - if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { - return this.tsParseThisTypePredicate(thisKeyword); - } else { - return thisKeyword; - } - } + return this.tsParseThisTypeOrThisTypePredicate(); case types._typeof: return this.tsParseTypeQuery(); @@ -4535,7 +5826,7 @@ var typescript = (superClass => class extends superClass { return; default: - this.raise(node.start, "'readonly' type modifier is only permitted on array and tuple literal types."); + this.raise(node.start, TSErrors.UnexpectedReadonly); } } @@ -4659,16 +5950,43 @@ var typescript = (superClass => class extends superClass { return this.tsInType(() => { const t = this.startNode(); this.expect(returnToken); + const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); + + if (asserts && this.match(types._this)) { + let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); + + if (thisTypePredicate.type === "TSThisType") { + const node = this.startNodeAtNode(t); + node.parameterName = thisTypePredicate; + node.asserts = true; + thisTypePredicate = this.finishNode(node, "TSTypePredicate"); + } else { + thisTypePredicate.asserts = true; + } + + t.typeAnnotation = thisTypePredicate; + return this.finishNode(t, "TSTypeAnnotation"); + } + const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); if (!typePredicateVariable) { - return this.tsParseTypeAnnotation(false, t); + if (!asserts) { + return this.tsParseTypeAnnotation(false, t); + } + + const node = this.startNodeAtNode(t); + node.parameterName = this.parseIdentifier(); + node.asserts = asserts; + t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); + return this.finishNode(t, "TSTypeAnnotation"); } const type = this.tsParseTypeAnnotation(false); - const node = this.startNodeAtNode(typePredicateVariable); + const node = this.startNodeAtNode(t); node.parameterName = typePredicateVariable; node.typeAnnotation = type; + node.asserts = asserts; t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); return this.finishNode(t, "TSTypeAnnotation"); }); @@ -4695,6 +6013,25 @@ var typescript = (superClass => class extends superClass { } } + 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); @@ -4749,7 +6086,7 @@ var typescript = (superClass => class extends superClass { const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", this.tsParseExpressionWithTypeArguments.bind(this)); if (!delimitedList.length) { - this.raise(originalStart, `'${descriptor}' list cannot be empty.`); + this.raise(originalStart, TSErrors.EmptyHeritageClauseType, descriptor); } return delimitedList; @@ -4768,7 +6105,7 @@ var typescript = (superClass => class extends superClass { tsParseInterfaceDeclaration(node) { node.id = this.parseIdentifier(); - this.checkLVal(node.id, BIND_TS_INTERFACE, undefined, "typescript interface declaration"); + this.checkLVal(node.id, "typescript interface declaration", BIND_TS_INTERFACE); node.typeParameters = this.tsTryParseTypeParameters(); if (this.eat(types._extends)) { @@ -4783,9 +6120,19 @@ var typescript = (superClass => class extends superClass { tsParseTypeAliasDeclaration(node) { node.id = this.parseIdentifier(); - this.checkLVal(node.id, BIND_TS_TYPE, undefined, "typescript type alias"); + this.checkLVal(node.id, "typescript type alias", BIND_TS_TYPE); node.typeParameters = this.tsTryParseTypeParameters(); - node.typeAnnotation = this.tsExpectThenParseType(types.eq); + 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"); } @@ -4836,7 +6183,7 @@ var typescript = (superClass => class extends superClass { node.id = this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true); if (this.eat(types.eq)) { - node.initializer = this.parseMaybeAssign(); + node.initializer = this.parseMaybeAssignAllowIn(); } return this.finishNode(node, "TSEnumMember"); @@ -4845,7 +6192,7 @@ var typescript = (superClass => class extends superClass { tsParseEnumDeclaration(node, isConst) { if (isConst) node.const = true; node.id = this.parseIdentifier(); - this.checkLVal(node.id, isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM, undefined, "typescript enum declaration"); + 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); @@ -4865,7 +6212,7 @@ var typescript = (superClass => class extends superClass { node.id = this.parseIdentifier(); if (!nested) { - this.checkLVal(node.id, BIND_TS_NAMESPACE, null, "module or namespace declaration"); + this.checkLVal(node.id, "module or namespace declaration", BIND_TS_NAMESPACE); } if (this.eat(types.dot)) { @@ -4873,7 +6220,11 @@ var typescript = (superClass => class extends superClass { 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"); @@ -4890,7 +6241,11 @@ var typescript = (superClass => class extends superClass { } 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(); } @@ -4901,6 +6256,7 @@ var typescript = (superClass => class extends superClass { 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(); @@ -4908,7 +6264,7 @@ var typescript = (superClass => class extends superClass { } tsIsExternalModuleReference() { - return this.isContextual("require") && this.lookahead().type === types.parenL; + return this.isContextual("require") && this.lookaheadCharCode() === 40; } tsParseModuleReference() { @@ -4937,18 +6293,10 @@ var typescript = (superClass => class extends superClass { } tsTryParseAndCatch(f) { - const state = this.state.clone(); - - try { - return f(); - } catch (e) { - if (e instanceof SyntaxError) { - this.state = state; - return undefined; - } - - throw e; - } + 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) { @@ -4976,35 +6324,39 @@ var typescript = (superClass => class extends superClass { kind = "let"; } - switch (starttype) { - case types._function: - return this.parseFunctionStatement(nany, false, true); + return this.tsInDeclareContext(() => { + switch (starttype) { + case types._function: + nany.declare = true; + return this.parseFunctionStatement(nany, false, true); - case types._class: - return this.parseClass(nany, true, false); + 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._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._var: + kind = kind || this.state.value; + return this.parseVarStatement(nany, kind); - case types.name: - { - const value = this.state.value; + case types.name: + { + const value = this.state.value; - if (value === "global") { - return this.tsParseAmbientExternalModuleDeclaration(nany); - } else { - return this.tsParseDeclaration(nany, value, true); + if (value === "global") { + return this.tsParseAmbientExternalModuleDeclaration(nany); + } else { + return this.tsParseDeclaration(nany, value, true); + } } - } - } + } + }); } tsTryParseExportDeclaration() { @@ -5027,10 +6379,14 @@ var typescript = (superClass => class extends superClass { 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"); } @@ -5115,6 +6471,8 @@ var typescript = (superClass => class extends superClass { 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(); @@ -5123,6 +6481,7 @@ var typescript = (superClass => class extends superClass { this.expect(types.arrow); return node; }); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; if (!res) { return undefined; @@ -5137,6 +6496,11 @@ var typescript = (superClass => class extends superClass { 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"); @@ -5170,9 +6534,13 @@ var typescript = (superClass => class extends superClass { let accessibility; let readonly = false; - if (allowModifiers) { + if (allowModifiers !== undefined) { accessibility = this.parseAccessModifier(); readonly = !!this.tsParseModifier(["readonly"]); + + if (allowModifiers === false && (accessibility || readonly)) { + this.raise(startPos, TSErrors.UnexpectedParameterModifier); + } } const left = this.parseMaybeDefault(); @@ -5190,7 +6558,7 @@ var typescript = (superClass => class extends superClass { if (readonly) pp.readonly = readonly; if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { - throw this.raise(pp.start, "A parameter property may not be declared using a binding pattern."); + this.raise(pp.start, TSErrors.UnsupportedParameterPropertyKind); } pp.parameter = elt; @@ -5216,18 +6584,50 @@ var typescript = (superClass => class extends superClass { 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); } - checkFunctionStatementId(node) { + registerFunctionStatementId(node) { if (!node.body && node.id) { - this.checkLVal(node.id, BIND_TS_FN_TYPE, null, "function name"); + this.checkLVal(node.id, "function name", BIND_TS_AMBIENT); } else { - super.checkFunctionStatementId(...arguments); + super.registerFunctionStatementId(...arguments); } } - parseSubscript(base, startPos, startLoc, noCalls, state, maybeAsyncArrow) { + 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(); @@ -5238,7 +6638,7 @@ var typescript = (superClass => class extends superClass { if (this.isRelational("<")) { const result = this.tsTryParseAndCatch(() => { - if (!noCalls && this.atPossibleAsync(base)) { + if (!noCalls && this.atPossibleAsyncArrow(base)) { const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc); if (asyncArrowFn) { @@ -5253,10 +6653,13 @@ var typescript = (superClass => class extends superClass { if (typeArguments) { if (!noCalls && this.eat(types.parenL)) { node.arguments = this.parseCallExpressionArguments(types.parenR, false); + this.tsCheckForInvalidTypeCasts(node.arguments); node.typeParameters = typeArguments; - return this.finishCallExpression(node); + return this.finishCallExpression(node, state.optionalChainMember); } else if (this.match(types.backQuote)) { - return this.parseTaggedTemplateExpression(startPos, startLoc, base, state, typeArguments); + const result = this.parseTaggedTemplateExpression(base, startPos, startLoc, state); + result.typeParameters = typeArguments; + return result; } } @@ -5265,7 +6668,7 @@ var typescript = (superClass => class extends superClass { if (result) return result; } - return super.parseSubscript(base, startPos, startLoc, noCalls, state, maybeAsyncArrow); + return super.parseSubscript(base, startPos, startLoc, noCalls, state); } parseNewArguments(node) { @@ -5284,7 +6687,7 @@ var typescript = (superClass => class extends superClass { super.parseNewArguments(node); } - parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) { + 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; @@ -5298,10 +6701,11 @@ var typescript = (superClass => class extends superClass { } this.finishNode(node, "TSAsExpression"); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); + this.reScan_lt_gt(); + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec); } - return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn); + return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec); } checkReservedWord(word, startLoc, checkKeywords, isBinding) {} @@ -5309,11 +6713,30 @@ var typescript = (superClass => class extends superClass { checkDuplicateExports() {} parseImport(node) { - if (this.match(types.name) && this.lookahead().type === types.eq) { - return this.tsParseImportEqualsDeclaration(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 super.parseImport(node); + return importNode; } parseExport(node) { @@ -5332,6 +6755,13 @@ var typescript = (superClass => class extends superClass { 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); } } @@ -5376,58 +6806,63 @@ var typescript = (superClass => class extends superClass { return this.tsParseModifier(["public", "protected", "private"]); } - parseClassMember(classBody, member, state, constructorAllowsSuper) { + parseClassMember(classBody, member, state) { + this.tsParseModifiers(member, ["declare"]); const accessibility = this.parseAccessModifier(); if (accessibility) member.accessibility = accessibility; - super.parseClassMember(classBody, member, state, constructorAllowsSuper); + this.tsParseModifiers(member, ["declare"]); + + const callParseClassMember = () => { + super.parseClassMember(classBody, member, state); + }; + + if (member.declare) { + this.tsInDeclareContext(callParseClassMember); + } else { + callParseClassMember(); + } } - parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) { - const methodOrProp = member; - const prop = member; - const propOrIdx = member; - let abstract = false, - readonly = false; - const mod = this.tsParseModifier(["abstract", "readonly"]); + parseClassMemberWithIsStatic(classBody, member, state, isStatic) { + this.tsParseModifiers(member, ["abstract", "readonly", "declare"]); + const idx = this.tsTryParseIndexSignature(member); - switch (mod) { - case "readonly": - readonly = true; - abstract = !!this.tsParseModifier(["abstract"]); - break; + if (idx) { + classBody.body.push(idx); - case "abstract": - abstract = true; - readonly = !!this.tsParseModifier(["readonly"]); - break; - } + if (member.abstract) { + this.raise(member.start, TSErrors.IndexSignatureHasAbstract); + } - if (abstract) methodOrProp.abstract = true; - if (readonly) propOrIdx.readonly = true; + if (isStatic) { + this.raise(member.start, TSErrors.IndexSignatureHasStatic); + } - if (!abstract && !isStatic && !methodOrProp.accessibility) { - const idx = this.tsTryParseIndexSignature(member); + if (member.accessibility) { + this.raise(member.start, TSErrors.IndexSignatureHasAccessibility, member.accessibility); + } - if (idx) { - classBody.body.push(idx); - return; + if (member.declare) { + this.raise(member.start, TSErrors.IndexSignatureHasDeclare); } - } - if (readonly) { - methodOrProp.static = isStatic; - this.parseClassPropertyName(prop); - this.parsePostMemberNameModifiers(methodOrProp); - this.pushClassProperty(classBody, prop); return; } - super.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper); + 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) { @@ -5440,24 +6875,20 @@ var typescript = (superClass => class extends superClass { return super.shouldParseExportDeclaration(); } - parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) { + parseConditional(expr, startPos, startLoc, refNeedsArrowPos) { if (!refNeedsArrowPos || !this.match(types.question)) { - return super.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); + return super.parseConditional(expr, startPos, startLoc, refNeedsArrowPos); } - const state = this.state.clone(); - - try { - return super.parseConditional(expr, noIn, startPos, startLoc); - } catch (err) { - if (!(err instanceof SyntaxError)) { - throw err; - } + const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc)); - this.state = state; - refNeedsArrowPos.start = err.pos || this.state.start; + 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) { @@ -5492,6 +6923,10 @@ var typescript = (superClass => class extends superClass { 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; @@ -5505,23 +6940,50 @@ var typescript = (superClass => class extends superClass { return; } - super.parseClassId(...arguments); + super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS); const typeParameters = this.tsTryParseTypeParameters(); if (typeParameters) node.typeParameters = typeParameters; } - parseClassProperty(node) { + 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); } @@ -5580,94 +7042,99 @@ var typescript = (superClass => class extends superClass { } parseMaybeAssign(...args) { - let jsxError; + var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3; - if (this.match(types.jsxTagStart)) { - const context = this.curContext(); - assert(context === types$1.j_oTag); - assert(this.state.context[this.state.context.length - 2] === types$1.j_expr); - const state = this.state.clone(); + let state; + let jsx; + let typeCast; - try { - return super.parseMaybeAssign(...args); - } catch (err) { - if (!(err instanceof SyntaxError)) { - throw err; - } + if (this.match(types.jsxTagStart)) { + state = this.state.clone(); + jsx = this.tryParse(() => super.parseMaybeAssign(...args), state); + if (!jsx.error) return jsx.node; + const { + context + } = this.state; - this.state = state; - assert(this.curContext() === types$1.j_oTag); - this.state.context.pop(); - assert(this.curContext() === types$1.j_expr); - this.state.context.pop(); - jsxError = err; + 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 (jsxError === undefined && !this.isRelational("<")) { + if (!((_jsx = jsx) == null ? void 0 : _jsx.error) && !this.isRelational("<")) { return super.parseMaybeAssign(...args); } - let arrowExpression; let typeParameters; - const state = this.state.clone(); + state = state || this.state.clone(); + const arrow = this.tryParse(abort => { + var _typeParameters; - try { typeParameters = this.tsParseTypeParameters(); - arrowExpression = super.parseMaybeAssign(...args); + const expr = super.parseMaybeAssign(...args); - if (arrowExpression.type !== "ArrowFunctionExpression" || arrowExpression.extra && arrowExpression.extra.parenthesized) { - this.unexpected(); - } - } catch (err) { - if (!(err instanceof SyntaxError)) { - throw err; + if (expr.type !== "ArrowFunctionExpression" || expr.extra && expr.extra.parenthesized) { + abort(); } - if (jsxError) { - throw jsxError; + 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")); - this.state = state; - return super.parseMaybeAssign(...args); + 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 (typeParameters && typeParameters.params.length !== 0) { - this.resetStartLocationFromNode(arrowExpression, typeParameters); + if (arrow.node) { + this.state = arrow.failState; + return arrow.node; } - arrowExpression.typeParameters = typeParameters; - return arrowExpression; + 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(refShorthandDefaultPos) { + parseMaybeUnary(refExpressionErrors) { if (!this.hasPlugin("jsx") && this.isRelational("<")) { return this.tsParseTypeAssertion(); } else { - return super.parseMaybeUnary(refShorthandDefaultPos); + return super.parseMaybeUnary(refExpressionErrors); } } parseArrow(node) { if (this.match(types.colon)) { - const state = this.state.clone(); - - try { + 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 (this.canInsertSemicolon() || !this.match(types.arrow)) { - this.state = state; - return undefined; - } - - node.returnType = returnType; - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - } else { - throw err; - } + if (!result.thrown) { + if (result.error) this.state = result.failState; + node.returnType = result.node; } } @@ -5676,8 +7143,8 @@ var typescript = (superClass => class extends superClass { parseAssignableListItemTypes(param) { if (this.eat(types.question)) { - if (param.type !== "Identifier") { - throw this.raise(param.start, "A binding pattern parameter cannot be optional in an implementation signature."); + if (param.type !== "Identifier" && !this.state.isDeclareContext && !this.state.inType) { + this.raise(param.start, TSErrors.PatternIsOptional); } param.optional = true; @@ -5689,42 +7156,42 @@ var typescript = (superClass => class extends superClass { return param; } - toAssignable(node, isBinding, contextDescription) { + toAssignable(node, isLHS = false) { switch (node.type) { case "TSTypeCastExpression": - return super.toAssignable(this.typeCastToParameter(node), isBinding, contextDescription); + return super.toAssignable(this.typeCastToParameter(node), isLHS); case "TSParameterProperty": - return super.toAssignable(node, isBinding, contextDescription); + return super.toAssignable(node, isLHS); case "TSAsExpression": case "TSNonNullExpression": case "TSTypeAssertion": - node.expression = this.toAssignable(node.expression, isBinding, contextDescription); + node.expression = this.toAssignable(node.expression, isLHS); return node; default: - return super.toAssignable(node, isBinding, contextDescription); + return super.toAssignable(node, isLHS); } } - checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) { + checkLVal(expr, contextDescription, ...args) { switch (expr.type) { case "TSTypeCastExpression": return; case "TSParameterProperty": - this.checkLVal(expr.parameter, bindingType, checkClashes, "parameter property"); + this.checkLVal(expr.parameter, "parameter property", ...args); return; case "TSAsExpression": case "TSNonNullExpression": case "TSTypeAssertion": - this.checkLVal(expr.expression, bindingType, checkClashes, contextDescription); + this.checkLVal(expr.expression, contextDescription, ...args); return; default: - super.checkLVal(expr, bindingType, checkClashes, contextDescription); + super.checkLVal(expr, contextDescription, ...args); return; } } @@ -5767,7 +7234,7 @@ var typescript = (superClass => class extends superClass { const node = super.parseMaybeDefault(...args); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, " + "e.g. instead of `age = 25: number` use `age: number = 25`"); + this.raise(node.typeAnnotation.start, TSErrors.TypeAnnotationAfterAssign); } return node; @@ -5781,7 +7248,18 @@ var typescript = (superClass => class extends superClass { } } - toAssignableList(exprList, isBinding, contextDescription) { + 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; @@ -5793,30 +7271,23 @@ var typescript = (superClass => class extends superClass { case "TSAsExpression": case "TSTypeAssertion": - this.raise(expr.start, "Unexpected type cast in parameter position."); + if (!this.state.maybeInArrowParameters) { + exprList[i] = this.typeCastToParameter(expr); + } else { + this.raise(expr.start, TSErrors.UnexpectedTypeCastInParameter); + } + break; } } - return super.toAssignableList(exprList, isBinding, contextDescription); - } - - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end); - return node.expression; - } - - toReferencedList(exprList, isInParens) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - - if (expr && expr._exprListItem && expr.type === "TsTypeCastExpression") { - this.raise(expr.start, "Did not expect a type annotation here."); - } - } + return super.toAssignableList(...arguments); + } - return exprList; + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end); + return node.expression; } shouldParseArrow() { @@ -5842,11 +7313,35 @@ var typescript = (superClass => class extends superClass { getGetterSetterExpectedParamCount(method) { const baseCount = super.getGetterSetterExpectedParamCount(method); - const firstParam = method.params[0]; + 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; + } + } + }); types.placeholder = new TokenType("%%", { @@ -5943,6 +7438,7 @@ var placeholders = (superClass => class extends superClass { const type = isStatement ? "ClassDeclaration" : "ClassExpression"; this.next(); this.takeDecorators(node); + const oldStrict = this.state.strict; const placeholder = this.parsePlaceholder("Identifier"); if (placeholder) { @@ -5960,7 +7456,7 @@ var placeholders = (superClass => class extends superClass { } this.parseClassSuper(node); - node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass); + node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass, oldStrict); return this.finishNode(node, type); } @@ -5982,6 +7478,20 @@ var placeholders = (superClass => class extends superClass { 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; @@ -5995,7 +7505,7 @@ var placeholders = (superClass => class extends superClass { specifiers } = node; - if (specifiers && specifiers.length) { + if (specifiers == null ? void 0 : specifiers.length) { node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); } @@ -6036,6 +7546,33 @@ var placeholders = (superClass => class extends superClass { }); +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)) { @@ -6059,313 +7596,115 @@ function getPluginOption(plugins, name, option) { } return null; -} -const PIPELINE_PROPOSALS = ["minimal", "smart", "fsharp"]; -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, "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(", ")); - } -} -const mixinPlugins = { - estree, - jsx, - flow, - typescript, - 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 -}; -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 Position { - constructor(line, col) { - this.line = line; - this.column = col; - } - -} -class SourceLocation { - constructor(start, end) { - 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; - } - - 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); - } - - 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 && this.state.leadingComments.length > 0) { - const lastComment = last(this.state.leadingComments); - - if (firstChild.type === "ObjectProperty") { - if (lastComment.start >= 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) { - firstChild.trailingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } - } - } else if (node.type === "CallExpression" && node.arguments && node.arguments.length) { - const lastArg = last(node.arguments); - - if (lastArg && lastComment.start >= lastArg.start && lastComment.end <= node.end) { - 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) { - lastArg.trailingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } - } - } - } - - 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; - } - } +} +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"); } - this.state.commentPreviousNode = node; + const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport"); - if (trailingComments) { - if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) { - node.innerComments = trailingComments; - } else { - node.trailingComments = trailingComments; - } + 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."); } - - stack.push(node); } -} + if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) { + throw new Error("Cannot combine flow and typescript plugins."); + } -class LocationParser 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; + if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) { + throw new Error("Cannot combine placeholders and v8intrinsic plugins."); } - raise(pos, message, { - missingPluginNames, - code - } = {}) { - const loc = this.getLocationForPosition(pos); - message += ` (${loc.line}:${loc.column})`; - const err = new SyntaxError(message); - err.pos = pos; - err.loc = loc; + 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 (missingPluginNames) { - err.missingPlugin = missingPluginNames; + if (hasPlugin(plugins, "moduleAttributes")) { + if (hasPlugin(plugins, "importAssertions")) { + throw new Error("Cannot combine importAssertions and moduleAttributes plugins."); } - if (code !== undefined) { - err.code = code; + 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 = {}; - throw err; + 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.commaAfterSpreadAt = -1; - this.inParameters = false; this.maybeInArrowParameters = false; this.inPipeline = false; this.inType = false; this.noAnonFunctionType = false; this.inPropertyName = false; - this.inClassProperty = false; this.hasFlowComment = false; this.isIterator = false; + this.isDeclareContext = false; this.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: null }; this.soloAwait = false; this.inFSharpPipelineDirectBody = false; - this.classLevel = 0; this.labels = []; this.decoratorStack = [[]]; - this.yieldPos = 0; - this.awaitPos = 0; - this.tokens = []; this.comments = []; this.trailingComments = []; this.leadingComments = []; @@ -6384,10 +7723,9 @@ class State { this.context = [types$1.braceStatement]; this.exprAllowed = true; this.containsEsc = false; - this.containsOctal = false; - this.octalPosition = null; + this.octalPositions = []; this.exportedIdentifiers = []; - this.invalidTemplateEscapePosition = null; + this.tokensLength = 0; } init(options) { @@ -6443,9 +7781,11 @@ class Token { } } -class Tokenizer extends LocationParser { +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; @@ -6453,9 +7793,19 @@ class Tokenizer extends LocationParser { this.isLookahead = false; } + pushToken(token) { + this.tokens.length = this.state.tokensLength; + this.tokens.push(token); + ++this.state.tokensLength; + } + next() { - if (this.options.tokens && !this.isLookahead) { - this.state.tokens.push(new Token(this.state)); + if (!this.isLookahead) { + this.checkKeywordEscapes(); + + if (this.options.tokens) { + this.pushToken(new Token(this.state)); + } } this.state.lastTokEnd = this.state.end; @@ -6489,6 +7839,20 @@ class Tokenizer extends LocationParser { 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 (!this.match(types.num) && !this.match(types.string)) return; @@ -6508,9 +7872,8 @@ class Tokenizer extends LocationParser { nextToken() { const curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) this.skipSpace(); - this.state.containsOctal = false; - this.state.octalPosition = null; + if (!(curContext == null ? void 0 : curContext.preserveSpace)) this.skipSpace(); + this.state.octalPositions = []; this.state.start = this.state.pos; this.state.startLoc = this.state.curPosition(); @@ -6519,8 +7882,10 @@ class Tokenizer extends LocationParser { return; } - if (curContext.override) { - curContext.override(this); + const override = curContext == null ? void 0 : curContext.override; + + if (override) { + override(this); } else { this.getTokenFromCode(this.input.codePointAt(this.state.pos)); } @@ -6534,7 +7899,7 @@ class Tokenizer extends LocationParser { end: end, loc: new SourceLocation(startLoc, endLoc) }; - if (this.options.tokens) this.state.tokens.push(comment); + if (this.options.tokens) this.pushToken(comment); this.state.comments.push(comment); this.addComment(comment); } @@ -6542,8 +7907,8 @@ class Tokenizer extends LocationParser { skipBlockComment() { const startLoc = this.state.curPosition(); const start = this.state.pos; - const end = this.input.indexOf("*/", this.state.pos += 2); - if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); + 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; @@ -6563,7 +7928,7 @@ class Tokenizer extends LocationParser { let ch = this.input.charCodeAt(this.state.pos += startSkip); if (this.state.pos < this.length) { - while (ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233 && ++this.state.pos < this.length) { + while (!isNewLine(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } } @@ -6641,17 +8006,25 @@ class Tokenizer extends LocationParser { const next = this.input.charCodeAt(nextPos); if (next >= 48 && next <= 57) { - this.raise(this.state.pos, "Unexpected digit after hash token"); + throw this.raise(this.state.pos, ErrorMessages.UnexpectedDigitAfterHash); } - if ((this.hasPlugin("classPrivateProperties") || this.hasPlugin("classPrivateMethods")) && this.state.classLevel > 0) { - ++this.state.pos; - this.finishToken(types.hash); - return; - } else if (this.getPluginOption("pipelineOperator", "proposal") === "smart") { - this.finishOp(types.hash, 1); + 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.raise(this.state.pos, "Unexpected character '#'"); + this.finishOp(types.hash, 1); } } @@ -6663,9 +8036,7 @@ class Tokenizer extends LocationParser { return; } - const next2 = this.input.charCodeAt(this.state.pos + 2); - - if (next === 46 && next2 === 46) { + if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { this.state.pos += 3; this.finishToken(types.ellipsis); } else { @@ -6692,12 +8063,12 @@ class Tokenizer extends LocationParser { 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; - let ch = this.input.charCodeAt(this.state.pos); - if (ch !== 33) return false; - while (ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233 && ++this.state.pos < this.length) { + while (!isNewLine(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } @@ -6744,6 +8115,24 @@ class Tokenizer extends LocationParser { 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) { @@ -6768,7 +8157,7 @@ class Tokenizer extends LocationParser { 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 || lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos)))) { + 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(); @@ -6837,7 +8226,7 @@ class Tokenizer extends LocationParser { const next = this.input.charCodeAt(this.state.pos + 1); const next2 = this.input.charCodeAt(this.state.pos + 2); - if (next === 63 && !this.state.inType) { + if (next === 63) { if (next2 === 61) { this.finishOp(types.assign, 3); } else { @@ -6879,8 +8268,18 @@ class Tokenizer extends LocationParser { return; case 91: - ++this.state.pos; - this.finishToken(types.bracketL); + 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: @@ -6889,8 +8288,18 @@ class Tokenizer extends LocationParser { return; case 123: - ++this.state.pos; - this.finishToken(types.braceL); + 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: @@ -7012,7 +8421,7 @@ class Tokenizer extends LocationParser { } - this.raise(this.state.pos, `Unexpected character '${String.fromCodePoint(code)}'`); + throw this.raise(this.state.pos, ErrorMessages.InvalidOrUnexpectedToken, String.fromCodePoint(code)); } finishOp(type, size) { @@ -7027,13 +8436,13 @@ class Tokenizer extends LocationParser { for (;;) { if (this.state.pos >= this.length) { - this.raise(start, "Unterminated regular expression"); + throw this.raise(start, ErrorMessages.UnterminatedRegExp); } const ch = this.input.charAt(this.state.pos); if (lineBreak.test(ch)) { - this.raise(start, "Unterminated regular expression"); + throw this.raise(start, ErrorMessages.UnterminatedRegExp); } if (escaped) { @@ -7063,16 +8472,16 @@ class Tokenizer extends LocationParser { if (VALID_REGEX_FLAGS.has(char)) { if (mods.indexOf(char) > -1) { - this.raise(this.state.pos + 1, "Duplicate regular expression flag"); + this.raise(this.state.pos + 1, ErrorMessages.DuplicateRegExpFlags); } - - ++this.state.pos; - mods += char; } else if (isIdentifierChar(charCode) || charCode === 92) { - this.raise(this.state.pos + 1, "Invalid regular expression flag"); + this.raise(this.state.pos + 1, ErrorMessages.MalformedRegExpFlags); } else { break; } + + ++this.state.pos; + mods += char; } this.finishToken(types.regexp, { @@ -7081,32 +8490,33 @@ class Tokenizer extends LocationParser { }); } - readInt(radix, len) { + 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 (this.hasPlugin("numericSeparator")) { + if (code === 95) { const prev = this.input.charCodeAt(this.state.pos - 1); const next = this.input.charCodeAt(this.state.pos + 1); - if (code === 95) { - if (allowedSiblings.indexOf(next) === -1) { - this.raise(this.state.pos, "Invalid or unexpected token"); - } - - if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) { - this.raise(this.state.pos, "Invalid or unexpected token"); - } + 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); + } - ++this.state.pos; - continue; + if (!allowNumSeparator) { + this.raise(this.state.pos, ErrorMessages.NumericSeparatorInEscapeSequence); } + + ++this.state.pos; + continue; } if (code >= 97) { @@ -7119,12 +8529,23 @@ class Tokenizer extends LocationParser { val = Infinity; } - if (val >= radix) break; + 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) { + if (this.state.pos === start || len != null && this.state.pos - start !== len || invalid) { return null; } @@ -7138,18 +8559,20 @@ class Tokenizer extends LocationParser { const val = this.readInt(radix); if (val == null) { - this.raise(this.state.start + 2, "Expected number in radix " + radix); + this.raise(this.state.start + 2, ErrorMessages.InvalidDigit, radix); } - if (this.hasPlugin("bigInt")) { - if (this.input.charCodeAt(this.state.pos) === 110) { - ++this.state.pos; - isBigInt = true; - } + 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))) { - this.raise(this.state.pos, "Identifier directly after number"); + throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier); } if (isBigInt) { @@ -7165,64 +8588,94 @@ class Tokenizer extends LocationParser { 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, "Invalid number"); + this.raise(start, ErrorMessages.InvalidNumber); } - let octal = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; + const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; + + if (hasLeadingZero) { + const integer = this.input.slice(start, this.state.pos); - if (octal) { if (this.state.strict) { - this.raise(start, "Legacy octal literals are not allowed in strict mode"); - } + this.raise(start, ErrorMessages.StrictOctalLiteral); + } else { + const underscorePos = integer.indexOf("_"); - if (/[89]/.test(this.input.slice(start, this.state.pos))) { - octal = false; + 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 && !octal) { + if (next === 46 && !isOctal) { ++this.state.pos; this.readInt(10); isFloat = true; next = this.input.charCodeAt(this.state.pos); } - if ((next === 69 || next === 101) && !octal) { + 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, "Invalid number"); + if (this.readInt(10) === null) { + this.raise(start, ErrorMessages.InvalidOrMissingExponent); + } + isFloat = true; + hasExponent = true; next = this.input.charCodeAt(this.state.pos); } - if (this.hasPlugin("bigInt")) { - if (next === 110) { - if (isFloat || octal) this.raise(start, "Invalid BigIntLiteral"); - ++this.state.pos; - isBigInt = true; + 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))) { - this.raise(this.state.pos, "Identifier directly after number"); + throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier); } - const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, ""); + const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); if (isBigInt) { this.finishToken(types.bigint, str); return; } - const val = octal ? parseInt(str, 8) : parseFloat(str); + if (isDecimal) { + this.finishToken(types.decimal, str); + return; + } + + const val = isOctal ? parseInt(str, 8) : parseFloat(str); this.finishToken(types.num, val); } @@ -7232,21 +8685,18 @@ class Tokenizer extends LocationParser { if (ch === 123) { const codePos = ++this.state.pos; - code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, throwOnInvalid); + code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, true, throwOnInvalid); ++this.state.pos; - if (code === null) { - --this.state.invalidTemplateEscapePosition; - } else if (code > 0x10ffff) { + if (code !== null && code > 0x10ffff) { if (throwOnInvalid) { - this.raise(codePos, "Code point out of bounds"); + this.raise(codePos, ErrorMessages.InvalidCodePoint); } else { - this.state.invalidTemplateEscapePosition = codePos - 2; return null; } } } else { - code = this.readHexChar(4, throwOnInvalid); + code = this.readHexChar(4, false, throwOnInvalid); } return code; @@ -7258,7 +8708,7 @@ class Tokenizer extends LocationParser { for (;;) { if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated string constant"); + throw this.raise(this.state.start, ErrorMessages.UnterminatedString); } const ch = this.input.charCodeAt(this.state.pos); @@ -7271,8 +8721,9 @@ class Tokenizer extends LocationParser { } else if (ch === 8232 || ch === 8233) { ++this.state.pos; ++this.state.curLine; + this.state.lineStart = this.state.pos; } else if (isNewLine(ch)) { - this.raise(this.state.start, "Unterminated string constant"); + throw this.raise(this.state.start, ErrorMessages.UnterminatedString); } else { ++this.state.pos; } @@ -7289,7 +8740,7 @@ class Tokenizer extends LocationParser { for (;;) { if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated template"); + throw this.raise(this.state.start, ErrorMessages.UnterminatedTemplate); } const ch = this.input.charCodeAt(this.state.pos); @@ -7365,7 +8816,7 @@ class Tokenizer extends LocationParser { case 120: { - const code = this.readHexChar(2, throwOnInvalid); + const code = this.readHexChar(2, false, throwOnInvalid); return code === null ? null : String.fromCharCode(code); } @@ -7400,10 +8851,19 @@ class Tokenizer extends LocationParser { case 8233: return ""; + case 56: + case 57: + if (inTemplate) { + return null; + } else if (this.state.strict) { + this.raise(this.state.pos - 1, ErrorMessages.StrictNumericEscape); + } + default: if (ch >= 48 && ch <= 55) { const codePos = this.state.pos - 1; - let octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0]; + 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) { @@ -7416,13 +8876,11 @@ class Tokenizer extends LocationParser { if (octalStr !== "0" || next === 56 || next === 57) { if (inTemplate) { - this.state.invalidTemplateEscapePosition = codePos; return null; } else if (this.state.strict) { - this.raise(codePos, "Octal literal in strict mode"); - } else if (!this.state.containsOctal) { - this.state.containsOctal = true; - this.state.octalPosition = codePos; + this.raise(codePos, ErrorMessages.StrictNumericEscape); + } else { + this.state.octalPositions.push(codePos); } } @@ -7433,16 +8891,15 @@ class Tokenizer extends LocationParser { } } - readHexChar(len, throwOnInvalid) { + readHexChar(len, forceLen, throwOnInvalid) { const codePos = this.state.pos; - const n = this.readInt(16, len); + const n = this.readInt(16, len, forceLen, false); if (n === null) { if (throwOnInvalid) { - this.raise(codePos, "Bad character escape sequence"); + this.raise(codePos, ErrorMessages.InvalidEscapeSequence); } else { this.state.pos = codePos - 1; - this.state.invalidTemplateEscapePosition = codePos - 1; } } @@ -7469,17 +8926,21 @@ class Tokenizer extends LocationParser { const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; if (this.input.charCodeAt(++this.state.pos) !== 117) { - this.raise(this.state.pos, "Expecting Unicode escape sequence \\uXXXX"); + this.raise(this.state.pos, ErrorMessages.MissingUnicodeEscape); + continue; } ++this.state.pos; const esc = this.readCodePoint(true); - if (!identifierCheck(esc, true)) { - this.raise(escStart, "Invalid Unicode escape"); + if (esc !== null) { + if (!identifierCheck(esc)) { + this.raise(escStart, ErrorMessages.EscapedCharNotAnIdentifier); + } + + word += String.fromCodePoint(esc); } - word += String.fromCodePoint(esc); chunkStart = this.state.pos; } else { break; @@ -7497,17 +8958,21 @@ class Tokenizer extends LocationParser { const word = this.readWord1(); const type = keywords.get(word) || types.name; - if (type.keyword && this.state.containsEsc) { - this.raise(this.state.pos, `Escape sequence in keyword ${word}`); - } - if (this.state.isIterator && (!this.isIterator(word) || !this.state.inType)) { - this.raise(this.state.pos, `Invalid identifier ${word}`); + 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(); @@ -7520,7 +8985,7 @@ class Tokenizer extends LocationParser { } if (prevType === types._return || prevType === types.name && this.state.exprAllowed) { - return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); + return this.hasPrecedingLineBreak(); } if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) { @@ -7557,7 +9022,6 @@ class Tokenizer extends LocationParser { } -const literal = /^('|")((?:\\?.)*?)\1/; class UtilParser extends Tokenizer { addExtra(node, key, val) { if (!node) return; @@ -7569,11 +9033,6 @@ class UtilParser extends Tokenizer { return this.match(types.relational) && this.state.value === op; } - isLookaheadRelational(op) { - const l = this.lookahead(); - return l.type === types.relational && l.value === op; - } - expectRelational(op) { if (this.isRelational(op)) { this.next(); @@ -7582,22 +9041,18 @@ class UtilParser extends Tokenizer { } } - eatRelational(op) { - if (this.isRelational(op)) { - this.next(); - return true; - } - - return false; - } - 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 l = this.lookahead(); - return l.type === types.name && l.value === name; + const next = this.nextTokenStart(); + return this.isUnparsedContextual(next, name); } eatContextual(name) { @@ -7644,9 +9099,9 @@ class UtilParser extends Tokenizer { expectPlugin(name, pos) { if (!this.hasPlugin(name)) { - throw this.raise(pos != null ? pos : this.state.start, `This experimental syntax requires enabling the parser plugin: '${name}'`, { - missingPluginNames: [name] - }); + throw this.raiseWithData(pos != null ? pos : this.state.start, { + missingPlugin: [name] + }, `This experimental syntax requires enabling the parser plugin: '${name}'`); } return true; @@ -7654,51 +9109,117 @@ class UtilParser extends Tokenizer { expectOnePlugin(names, pos) { if (!names.some(n => this.hasPlugin(n))) { - throw this.raise(pos != null ? pos : this.state.start, `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join(", ")}'`, { - missingPluginNames: names - }); + 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(", ")}'`); } } - checkYieldAwaitInDefaultParams() { - if (this.state.yieldPos && (!this.state.awaitPos || this.state.yieldPos < this.state.awaitPos)) { - this.raise(this.state.yieldPos, "Yield cannot be used as name inside a generator function"); - } + 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 (this.state.awaitPos) { - this.raise(this.state.awaitPos, "Await cannot be used as name inside an async function"); + if (error === abortSignal) { + return { + node: abortSignal.node, + error: null, + thrown: false, + aborted: true, + failState + }; + } + + throw error; } } - strictDirective(start) { - for (;;) { - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; - const match = literal.exec(this.input.slice(start)); - if (!match) break; - if (match[2] === "use strict") return true; - start += match[0].length; - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; + checkExpressionErrors(refExpressionErrors, andThrow) { + if (!refExpressionErrors) return false; + const { + shorthandAssign, + doubleProto + } = refExpressionErrors; + if (!andThrow) return shorthandAssign >= 0 || doubleProto >= 0; - if (this.input[start] === ";") { - start++; - } + if (shorthandAssign >= 0) { + this.unexpected(shorthandAssign); } - return false; + 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); + } + +} +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 && parser.options.ranges) this.range = [pos, 0]; - if (parser && parser.filename) this.loc.filename = parser.filename; + 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() { @@ -7763,101 +9284,123 @@ class NodeUtils extends UtilParser { } +const unwrapParenthesizedExpression = node => { + return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; +}; + class LValParser extends NodeUtils { - toAssignable(node, isBinding, contextDescription) { - if (node) { - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - break; + toAssignable(node, isLHS = false) { + var _node$extra, _node$extra3; - case "ObjectExpression": - node.type = "ObjectPattern"; + let parenthesized = undefined; - for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { - const prop = node.properties[i]; - const isLast = i === last; - this.toAssignableObjectExpressionProp(prop, isBinding, isLast); - } + if (node.type === "ParenthesizedExpression" || ((_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized)) { + parenthesized = unwrapParenthesizedExpression(node); - break; + 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); + } + } - case "ObjectProperty": - this.toAssignable(node.value, isBinding, contextDescription); - break; + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + break; - case "SpreadElement": - { - this.checkToRestConversion(node); - node.type = "RestElement"; - const arg = node.argument; - this.toAssignable(arg, isBinding, contextDescription); - break; - } + case "ObjectExpression": + node.type = "ObjectPattern"; - case "ArrayExpression": - node.type = "ArrayPattern"; - this.toAssignableList(node.elements, isBinding, contextDescription); - break; + for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { + var _node$extra2; - case "AssignmentExpression": - if (node.operator === "=") { - node.type = "AssignmentPattern"; - delete node.operator; - } else { - this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); + 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 "ParenthesizedExpression": - node.expression = this.toAssignable(node.expression, isBinding, contextDescription); - break; + case "AssignmentExpression": + if (node.operator !== "=") { + this.raise(node.left.end, ErrorMessages.MissingEqInAssignment); + } - case "MemberExpression": - if (!isBinding) break; + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isLHS); + break; - default: - { - const message = "Invalid left-hand side" + (contextDescription ? " in " + contextDescription : "expression"); - this.raise(node.start, message); - } - } + case "ParenthesizedExpression": + this.toAssignable(parenthesized, isLHS); + break; } return node; } - toAssignableObjectExpressionProp(prop, isBinding, isLast) { + toAssignableObjectExpressionProp(prop, isLast, isLHS) { if (prop.type === "ObjectMethod") { - const error = prop.kind === "get" || prop.kind === "set" ? "Object pattern can't contain getter or setter" : "Object pattern can't contain methods"; + 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, isBinding, "object destructuring pattern"); + this.toAssignable(prop, isLHS); } } - toAssignableList(exprList, isBinding, contextDescription) { + toAssignableList(exprList, trailingCommaPos, isLHS) { let end = exprList.length; if (end) { const last = exprList[end - 1]; - if (last && last.type === "RestElement") { + if ((last == null ? void 0 : last.type) === "RestElement") { --end; - } else if (last && last.type === "SpreadElement") { + } else if ((last == null ? void 0 : last.type) === "SpreadElement") { last.type = "RestElement"; - const arg = last.argument; - this.toAssignable(arg, isBinding, contextDescription); + 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; } } @@ -7866,7 +9409,7 @@ class LValParser extends NodeUtils { const elt = exprList[i]; if (elt) { - this.toAssignable(elt, isBinding, contextDescription); + this.toAssignable(elt, isLHS); if (elt.type === "RestElement") { this.raiseRestNotLast(elt.start); @@ -7887,23 +9430,16 @@ class LValParser extends NodeUtils { for (let _i = 0; _i < exprList.length; _i++) { const expr = exprList[_i]; - if (expr && expr.type === "ArrayExpression") { + if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { this.toReferencedListDeep(expr.elements); } } - - return exprList; } - parseSpread(refShorthandDefaultPos, refNeedsArrowPos) { + parseSpread(refExpressionErrors, refNeedsArrowPos) { const node = this.startNode(); this.next(); - node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos, undefined, refNeedsArrowPos); - - if (this.state.commaAfterSpreadAt === -1 && this.match(types.comma)) { - this.state.commaAfterSpreadAt = this.state.start; - } - + node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined, refNeedsArrowPos); return this.finishNode(node, "SpreadElement"); } @@ -7920,18 +9456,18 @@ class LValParser extends NodeUtils { { const node = this.startNode(); this.next(); - node.elements = this.parseBindingList(types.bracketR, true); + node.elements = this.parseBindingList(types.bracketR, 93, true); return this.finishNode(node, "ArrayPattern"); } case types.braceL: - return this.parseObj(true); + return this.parseObjectLike(types.braceR, true); } return this.parseIdentifier(); } - parseBindingList(close, allowEmpty, allowModifiers) { + parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) { const elts = []; let first = true; @@ -7948,14 +9484,14 @@ class LValParser extends NodeUtils { break; } else if (this.match(types.ellipsis)) { elts.push(this.parseAssignableListItemTypes(this.parseRestBinding())); - this.checkCommaAfterRest(); + this.checkCommaAfterRest(closeCharCode); this.expect(close); break; } else { const decorators = []; if (this.match(types.at) && this.hasPlugin("decorators")) { - this.raise(this.state.start, "Stage 2 decorators cannot be used to decorate parameters"); + this.raise(this.state.start, ErrorMessages.UnsupportedParameterDecorator); } while (this.match(types.at)) { @@ -7986,46 +9522,52 @@ class LValParser extends NodeUtils { } parseMaybeDefault(startPos, startLoc, left) { - startLoc = startLoc || this.state.startLoc; - startPos = startPos || this.state.start; - left = left || this.parseBindingAtom(); + 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.parseMaybeAssign(); + node.right = this.parseMaybeAssignAllowIn(); return this.finishNode(node, "AssignmentPattern"); } - checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) { + checkLVal(expr, contextDescription, bindingType = BIND_NONE, checkClashes, disallowLetBinding, strictModeChanged = false) { switch (expr.type) { case "Identifier": - if (this.state.strict && isStrictBindReservedWord(expr.name, this.inModule)) { - this.raise(expr.start, `${bindingType === BIND_NONE ? "Assigning to" : "Binding"} '${expr.name}' in strict mode`); - } + { + const { + name + } = expr; - if (checkClashes) { - const key = `_${expr.name}`; + 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[key]) { - this.raise(expr.start, "Argument name clash"); - } else { - checkClashes[key] = true; + if (checkClashes) { + if (checkClashes.has(name)) { + this.raise(expr.start, ErrorMessages.ParamDupe); + } else { + checkClashes.add(name); + } } - } - if (bindingType === BIND_LEXICAL && expr.name === "let") { - this.raise(expr.start, "'let' is not allowed to be used as a name in 'let' or 'const' declarations."); - } + if (disallowLetBinding && name === "let") { + this.raise(expr.start, ErrorMessages.LetInLexicalBinding); + } - if (!(bindingType & BIND_NONE)) { - this.scope.declareName(expr.name, bindingType, expr.start); - } + if (!(bindingType & BIND_NONE)) { + this.scope.declareName(name, bindingType, expr.start); + } - break; + break; + } case "MemberExpression": if (bindingType !== BIND_NONE) { - this.raise(expr.start, "Binding member expression"); + this.raise(expr.start, ErrorMessages.InvalidPropertyBindingPattern); } break; @@ -8033,8 +9575,8 @@ class LValParser extends NodeUtils { case "ObjectPattern": for (let _i2 = 0, _expr$properties = expr.properties; _i2 < _expr$properties.length; _i2++) { let prop = _expr$properties[_i2]; - if (prop.type === "ObjectProperty") prop = prop.value; - this.checkLVal(prop, bindingType, checkClashes, "object destructuring pattern"); + if (prop.type === "ObjectProperty") prop = prop.value;else if (prop.type === "ObjectMethod") continue; + this.checkLVal(prop, "object destructuring pattern", bindingType, checkClashes, disallowLetBinding); } break; @@ -8044,80 +9586,237 @@ class LValParser extends NodeUtils { const elem = _expr$elements[_i3]; if (elem) { - this.checkLVal(elem, bindingType, checkClashes, "array destructuring pattern"); + this.checkLVal(elem, "array destructuring pattern", bindingType, checkClashes, disallowLetBinding); } } break; case "AssignmentPattern": - this.checkLVal(expr.left, bindingType, checkClashes, "assignment pattern"); + this.checkLVal(expr.left, "assignment pattern", bindingType, checkClashes); break; case "RestElement": - this.checkLVal(expr.argument, bindingType, checkClashes, "rest element"); + this.checkLVal(expr.argument, "rest element", bindingType, checkClashes); break; case "ParenthesizedExpression": - this.checkLVal(expr.expression, bindingType, checkClashes, "parenthesized expression"); + this.checkLVal(expr.expression, "parenthesized expression", bindingType, checkClashes); break; default: { - const message = (bindingType === BIND_NONE ? "Invalid" : "Binding invalid") + " left-hand side" + (contextDescription ? " in " + contextDescription : "expression"); - this.raise(expr.start, message); + 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, "Invalid rest operator's argument"); + this.raise(node.argument.start, ErrorMessages.InvalidRestAssignmentPattern); } } - checkCommaAfterRest() { + checkCommaAfterRest(close) { if (this.match(types.comma)) { - this.raiseRestNotLast(this.state.start); + if (this.lookaheadCharCode() === close) { + this.raiseTrailingCommaAfterRest(this.state.start); + } else { + this.raiseRestNotLast(this.state.start); + } } } - checkCommaAfterRestFromSpread() { - if (this.state.commaAfterSpreadAt > -1) { - this.raiseRestNotLast(this.state.commaAfterSpreadAt); - } + raiseRestNotLast(pos) { + throw this.raise(pos, ErrorMessages.ElementAfterRest); } - raiseRestNotLast(pos) { - this.raise(pos, `Rest element must be last element`); + raiseTrailingCommaAfterRest(pos) { + this.raise(pos, ErrorMessages.RestTrailingComma); } } -const unwrapParenthesizedExpression = node => { - return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; -}; +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 ExpressionParser extends LValParser { - checkPropClash(prop, propHash) { - if (prop.type === "SpreadElement" || prop.computed || prop.kind || prop.shorthand) { + checkProto(prop, isRecord, protoRef, refExpressionErrors) { + if (prop.type === "SpreadElement" || prop.type === "ObjectMethod" || prop.computed || prop.shorthand) { return; } const key = prop.key; - const name = key.type === "Identifier" ? key.name : String(key.value); + const name = key.type === "Identifier" ? key.name : key.value; if (name === "__proto__") { - if (propHash.proto) { - this.raise(key.start, "Redefinition of __proto__ property"); + if (isRecord) { + this.raise(key.start, ErrorMessages.RecordNoProto); + return; } - propHash.proto = true; + 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(); @@ -8126,20 +9825,29 @@ class ExpressionParser extends LValParser { } expr.comments = this.state.comments; + expr.errors = this.state.errors; return expr; } - parseExpression(noIn, refShorthandDefaultPos) { + 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(noIn, refShorthandDefaultPos); + 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(noIn, refShorthandDefaultPos)); + node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); } this.toReferencedList(node.expressions); @@ -8149,42 +9857,45 @@ class ExpressionParser extends LValParser { return expr; } - parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) { + 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.scope.inGenerator) { - let left = this.parseYield(noIn); + if (this.prodParam.hasYield) { + this.state.exprAllowed = true; + let left = this.parseYield(); if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } return left; - } else { - this.state.exprAllowed = false; } } - const oldCommaAfterSpreadAt = this.state.commaAfterSpreadAt; - this.state.commaAfterSpreadAt = -1; - let failOnShorthandAssign; + let ownExpressionErrors; - if (refShorthandDefaultPos) { - failOnShorthandAssign = false; + if (refExpressionErrors) { + ownExpressionErrors = false; } else { - refShorthandDefaultPos = { - start: 0 - }; - failOnShorthandAssign = true; + refExpressionErrors = new ExpressionErrors(); + ownExpressionErrors = true; } if (this.match(types.parenL) || this.match(types.name)) { this.state.potentialArrowAt = this.state.start; } - let left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos); + let left = this.parseMaybeConditional(refExpressionErrors, refNeedsArrowPos); if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); @@ -8195,135 +9906,124 @@ class ExpressionParser extends LValParser { const operator = this.state.value; node.operator = operator; - if (operator === "??=") { - this.expectPlugin("nullishCoalescingOperator"); - this.expectPlugin("logicalAssignment"); - } - - if (operator === "||=" || operator === "&&=") { - this.expectPlugin("logicalAssignment"); - } - - node.left = this.match(types.eq) ? this.toAssignable(left, undefined, "assignment expression") : left; - refShorthandDefaultPos.start = 0; - this.checkLVal(left, undefined, undefined, "assignment expression"); - const maybePattern = unwrapParenthesizedExpression(left); - let patternErrorMsg; - - if (maybePattern.type === "ObjectPattern") { - patternErrorMsg = "`({a}) = 0` use `({a} = 0)`"; - } else if (maybePattern.type === "ArrayPattern") { - patternErrorMsg = "`([a]) = 0` use `([a] = 0)`"; + if (this.match(types.eq)) { + node.left = this.toAssignable(left, true); + refExpressionErrors.doubleProto = -1; + } else { + node.left = left; } - if (patternErrorMsg && (left.extra && left.extra.parenthesized || left.type === "ParenthesizedExpression")) { - this.raise(maybePattern.start, `You're trying to assign to a parenthesized expression, eg. instead of ${patternErrorMsg}`); + if (refExpressionErrors.shorthandAssign >= node.left.start) { + refExpressionErrors.shorthandAssign = -1; } - if (patternErrorMsg) this.checkCommaAfterRestFromSpread(); - this.state.commaAfterSpreadAt = oldCommaAfterSpreadAt; + this.checkLVal(left, "assignment expression"); this.next(); - node.right = this.parseMaybeAssign(noIn); + node.right = this.parseMaybeAssign(); return this.finishNode(node, "AssignmentExpression"); - } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); + } else if (ownExpressionErrors) { + this.checkExpressionErrors(refExpressionErrors, true); } - this.state.commaAfterSpreadAt = oldCommaAfterSpreadAt; return left; } - parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos) { + parseMaybeConditional(refExpressionErrors, refNeedsArrowPos) { const startPos = this.state.start; const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprOps(noIn, refShorthandDefaultPos); + const expr = this.parseExprOps(refExpressionErrors); - if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) { + if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); + return this.parseConditional(expr, startPos, startLoc, refNeedsArrowPos); } - parseConditional(expr, noIn, 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.parseMaybeAssign(); + node.consequent = this.parseMaybeAssignAllowIn(); this.expect(types.colon); - node.alternate = this.parseMaybeAssign(noIn); + node.alternate = this.parseMaybeAssign(); return this.finishNode(node, "ConditionalExpression"); } return expr; } - parseExprOps(noIn, refShorthandDefaultPos) { + parseExprOps(refExpressionErrors) { const startPos = this.state.start; const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseMaybeUnary(refShorthandDefaultPos); - - if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) { - return expr; - } + const expr = this.parseMaybeUnary(refExpressionErrors); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { + if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } - return this.parseExprOp(expr, startPos, startLoc, -1, noIn); + return this.parseExprOp(expr, startPos, startLoc, -1); } - parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) { - const prec = this.state.type.binop; + parseExprOp(left, leftStartPos, leftStartLoc, minPrec) { + let prec = this.state.type.binop; - if (prec != null && (!noIn || !this.match(types._in))) { + if (prec != null && (this.prodParam.hasIn || !this.match(types._in))) { if (prec > minPrec) { - const operator = this.state.value; + const op = this.state.type; + + if (op === types.pipeline) { + this.expectPlugin("pipelineOperator"); - if (operator === "|>" && this.state.inFSharpPipelineDirectBody) { - return left; + 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 = operator; + node.operator = this.state.value; - if (operator === "**" && left.type === "UnaryExpression" && (this.options.createParenthesizedExpressions || !(left.extra && left.extra.parenthesized))) { - this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses."); + if (op === types.exponent && left.type === "UnaryExpression" && (this.options.createParenthesizedExpressions || !(left.extra && left.extra.parenthesized))) { + this.raise(left.argument.start, ErrorMessages.UnexpectedTokenUnaryExponentiation); } - const op = this.state.type; + const logical = op === types.logicalOR || op === types.logicalAND; + const coalesce = op === types.nullishCoalescing; - if (op === types.pipeline) { - this.expectPlugin("pipelineOperator"); - this.state.inPipeline = true; - this.checkPipelineAtInfixOperator(left, leftStartPos); - } else if (op === types.nullishCoalescing) { - this.expectPlugin("nullishCoalescingOperator"); + 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.scope.inAsync) { - throw this.raise(this.state.start, `Unexpected "await" after pipeline body; await must have parentheses in minimal proposal`); + 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, noIn); - this.finishNode(node, op === types.logicalOR || op === types.logicalAND || op === types.nullishCoalescing ? "LogicalExpression" : "BinaryExpression"); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); + 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, noIn) { + parseExprOpRightExpr(op, prec) { const startPos = this.state.start; const startLoc = this.state.startLoc; @@ -8332,72 +10032,82 @@ class ExpressionParser extends LValParser { switch (this.getPluginOption("pipelineOperator", "proposal")) { case "smart": return this.withTopicPermittingContext(() => { - return this.parseSmartPipelineBody(this.parseExprOpBaseRightExpr(op, prec, noIn), startPos, startLoc); + return this.parseSmartPipelineBody(this.parseExprOpBaseRightExpr(op, prec), startPos, startLoc); }); case "fsharp": return this.withSoloAwaitPermittingContext(() => { - return this.parseFSharpPipelineBody(prec, noIn); + return this.parseFSharpPipelineBody(prec); }); } default: - return this.parseExprOpBaseRightExpr(op, prec, noIn); + return this.parseExprOpBaseRightExpr(op, prec); } } - parseExprOpBaseRightExpr(op, prec, noIn) { + 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, noIn); + return this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec); } - parseMaybeUnary(refShorthandDefaultPos) { - if (this.isContextual("await") && (this.scope.inAsync || !this.scope.inFunction && this.options.allowAwaitOutsideFunction)) { + parseMaybeUnary(refExpressionErrors) { + if (this.isContextual("await") && this.isAwaitAllowed()) { return this.parseAwait(); - } else if (this.state.type.prefix) { - const node = this.startNode(); - const update = this.match(types.incDec); + } + + const update = this.match(types.incDec); + const node = this.startNode(); + + if (this.state.type.prefix) { node.operator = this.state.value; node.prefix = true; - if (node.operator === "throw") { + 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 (refShorthandDefaultPos && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - - if (update) { - this.checkLVal(node.argument, undefined, undefined, "prefix operation"); - } else if (this.state.strict && node.operator === "delete") { + if (this.state.strict && isDelete) { const arg = node.argument; if (arg.type === "Identifier") { - this.raise(node.start, "Deleting local variable in strict mode"); - } else if (arg.type === "MemberExpression" && arg.property.type === "PrivateName") { - this.raise(node.start, "Deleting a private field is not allowed"); + this.raise(node.start, ErrorMessages.StrictDelete); + } else if ((arg.type === "MemberExpression" || arg.type === "OptionalMemberExpression") && arg.property.type === "PrivateName") { + this.raise(node.start, ErrorMessages.DeletePrivateField); } } - return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + if (!update) { + return this.finishNode(node, "UnaryExpression"); + } + } + + return this.parseUpdate(node, update, refExpressionErrors); + } + + 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(refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; + 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, undefined, undefined, "postfix operation"); + this.checkLVal(expr, "postfix operation"); this.next(); expr = this.finishNode(node, "UpdateExpression"); } @@ -8405,17 +10115,13 @@ class ExpressionParser extends LValParser { return expr; } - parseExprSubscripts(refShorthandDefaultPos) { + parseExprSubscripts(refExpressionErrors) { const startPos = this.state.start; const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprAtom(refShorthandDefaultPos); + const expr = this.parseExprAtom(refExpressionErrors); - if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) { - return expr; - } - - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { + if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } @@ -8423,178 +10129,173 @@ class ExpressionParser extends LValParser { } parseSubscripts(base, startPos, startLoc, noCalls) { - const maybeAsyncArrow = this.atPossibleAsync(base); const state = { optionalChainMember: false, + maybeAsyncArrow: this.atPossibleAsyncArrow(base), stop: false }; do { - base = this.parseSubscript(base, startPos, startLoc, noCalls, state, maybeAsyncArrow); + base = this.parseSubscript(base, startPos, startLoc, noCalls, state); + state.maybeAsyncArrow = false; } while (!state.stop); return base; } - parseSubscript(base, startPos, startLoc, noCalls, state, maybeAsyncArrow) { + parseSubscript(base, startPos, startLoc, noCalls, state) { if (!noCalls && this.eat(types.doubleColon)) { - 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); - } else if (this.match(types.questionDot)) { - this.expectPlugin("optionalChaining"); - state.optionalChainMember = true; + 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)) { + state.optionalChainMember = optional = true; - if (noCalls && this.lookahead().type === types.parenL) { + if (noCalls && this.lookaheadCharCode() === 40) { state.stop = true; return base; } this.next(); - const node = this.startNodeAt(startPos, startLoc); + } - if (this.eat(types.bracketL)) { - node.object = base; - node.property = this.parseExpression(); - node.computed = true; - node.optional = true; - this.expect(types.bracketR); - return this.finishNode(node, "OptionalMemberExpression"); - } else if (this.eat(types.parenL)) { - node.callee = base; - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - node.optional = true; - return this.finishNode(node, "OptionalCallExpression"); - } else { - node.object = base; - node.property = this.parseIdentifier(true); - node.computed = false; - node.optional = true; - return this.finishNode(node, "OptionalMemberExpression"); - } - } else if (this.eat(types.dot)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseMaybePrivateName(); - node.computed = false; + 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; + } + } - if (state.optionalChainMember) { - node.optional = false; - return this.finishNode(node, "OptionalMemberExpression"); + 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 (property.type === "PrivateName") { + if (node.object.type === "Super") { + this.raise(startPos, ErrorMessages.SuperPrivateField); } - return this.finishNode(node, "MemberExpression"); - } else if (this.eat(types.bracketL)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseExpression(); - node.computed = true; - this.expect(types.bracketR); + this.classScope.usePrivateName(property.id.name, property.start); + } - if (state.optionalChainMember) { - node.optional = false; - return this.finishNode(node, "OptionalMemberExpression"); - } + 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"); - } else if (!noCalls && this.match(types.parenL)) { - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - const oldYieldPos = this.state.yieldPos; - const oldAwaitPos = this.state.awaitPos; - this.state.maybeInArrowParameters = true; - this.state.yieldPos = 0; - this.state.awaitPos = 0; - this.next(); - let node = this.startNodeAt(startPos, startLoc); - node.callee = base; - const oldCommaAfterSpreadAt = this.state.commaAfterSpreadAt; - this.state.commaAfterSpreadAt = -1; - node.arguments = this.parseCallExpressionArguments(types.parenR, maybeAsyncArrow, base.type === "Import", base.type !== "Super"); - - if (!state.optionalChainMember) { - this.finishCallExpression(node); - } else { - this.finishOptionalCallExpression(node); - } + } + } - if (maybeAsyncArrow && this.shouldParseAsyncArrow()) { - state.stop = true; - this.checkCommaAfterRestFromSpread(); - node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); - this.checkYieldAwaitInDefaultParams(); - this.state.yieldPos = oldYieldPos; - this.state.awaitPos = oldAwaitPos; - } else { - this.toReferencedListDeep(node.arguments); - this.state.yieldPos = oldYieldPos || this.state.yieldPos; - this.state.awaitPos = oldAwaitPos || this.state.awaitPos; - } + 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); + } - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - this.state.commaAfterSpreadAt = oldCommaAfterSpreadAt; - return node; - } else if (this.match(types.backQuote)) { - return this.parseTaggedTemplateExpression(startPos, startLoc, base, state); + 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; - return base; + 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; } - parseTaggedTemplateExpression(startPos, startLoc, base, state, typeArguments) { + 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 (typeArguments) node.typeParameters = typeArguments; if (state.optionalChainMember) { - this.raise(startPos, "Tagged Template Literals are not allowed in optionalChain"); + this.raise(startPos, ErrorMessages.OptionalChainingNoTemplate); } return this.finishNode(node, "TaggedTemplateExpression"); } - atPossibleAsync(base) { - return base.type === "Identifier" && base.name === "async" && this.state.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async"; - } - - finishCallExpression(node) { - if (node.callee.type === "Import") { - if (node.arguments.length !== 1) { - this.raise(node.start, "import() requires exactly one argument"); - } - - const importArg = node.arguments[0]; - - if (importArg && importArg.type === "SpreadElement") { - this.raise(importArg.start, "... is not allowed in import()"); - } - } - - return this.finishNode(node, "CallExpression"); + 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; } - finishOptionalCallExpression(node) { + finishCallExpression(node, optional) { if (node.callee.type === "Import") { - if (node.arguments.length !== 1) { - this.raise(node.start, "import() requires exactly one argument"); + if (node.arguments.length === 2) { + if (!this.hasPlugin("moduleAttributes")) { + this.expectPlugin("importAssertions"); + } } - const importArg = node.arguments[0]; + 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 (importArg && importArg.type === "SpreadElement") { - this.raise(importArg.start, "... is not allowed in import()"); + if (arg.type === "SpreadElement") { + this.raise(arg.start, ErrorMessages.ImportCallSpreadArgument); + } + } } } - return this.finishNode(node, "OptionalCallExpression"); + return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); } - parseCallExpressionArguments(close, possibleAsyncArrow, dynamicImport, allowPlaceholder) { + parseCallExpressionArguments(close, possibleAsyncArrow, dynamicImport, allowPlaceholder, nodeForExtra) { const elts = []; - let innerParenStart; let first = true; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; @@ -8605,30 +10306,25 @@ class ExpressionParser extends LValParser { } else { this.expect(types.comma); - if (this.eat(close)) { - if (dynamicImport) { - this.raise(this.state.lastTokStart, "Trailing comma is disallowed inside import(...) arguments"); + 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; } } - if (this.match(types.parenL) && !innerParenStart) { - innerParenStart = this.state.start; - } - - elts.push(this.parseExprListItem(false, possibleAsyncArrow ? { - start: 0 - } : undefined, possibleAsyncArrow ? { + elts.push(this.parseExprListItem(false, possibleAsyncArrow ? new ExpressionErrors() : undefined, possibleAsyncArrow ? { start: 0 } : undefined, allowPlaceholder)); } - if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) { - this.unexpected(); - } - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return elts; } @@ -8638,8 +10334,10 @@ class ExpressionParser extends LValParser { } parseAsyncArrowFromCallExpression(node, call) { + var _call$extra; + this.expect(types.arrow); - this.parseArrowExpression(node, call.arguments, true); + this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingComma); return node; } @@ -8649,29 +10347,14 @@ class ExpressionParser extends LValParser { return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); } - parseExprAtom(refShorthandDefaultPos) { + 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: - if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { - this.raise(this.state.start, "super is only allowed in object methods and classes"); - } - - node = this.startNode(); - this.next(); - - if (this.match(types.parenL) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { - this.raise(node.start, "super() is only valid inside a class constructor of a subclass. " + "Maybe a typo in the method name ('constructor') or not extending another class?"); - } - - if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) { - this.unexpected(); - } - - return this.finishNode(node, "Super"); + return this.parseSuper(); case types._import: node = this.startNode(); @@ -8681,10 +10364,8 @@ class ExpressionParser extends LValParser { return this.parseImportMetaProperty(node); } - this.expectPlugin("dynamicImport", node.start); - if (!this.match(types.parenL)) { - this.unexpected(null, types.parenL); + this.raise(this.state.lastTokStart, ErrorMessages.UnsupportedImport); } return this.finishNode(node, "Import"); @@ -8696,24 +10377,28 @@ class ExpressionParser extends LValParser { case types.name: { - node = this.startNode(); const containsEsc = this.state.containsEsc; const id = this.parseIdentifier(); - if (!containsEsc && id.name === "async" && this.match(types._function) && !this.canInsertSemicolon()) { - this.next(); - return this.parseFunction(node, undefined, true); - } else if (canBeArrow && !containsEsc && id.name === "async" && this.match(types.name) && !this.canInsertSemicolon()) { - const params = [this.parseIdentifier()]; - this.expect(types.arrow); - this.parseArrowExpression(node, params, true); - return node; + 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(); - this.parseArrowExpression(node, [id], false); - return node; + return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); } return id; @@ -8721,14 +10406,7 @@ class ExpressionParser extends LValParser { case types._do: { - 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"); + return this.parseDo(); } case types.regexp: @@ -8746,6 +10424,9 @@ class ExpressionParser extends LValParser { 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"); @@ -8761,33 +10442,30 @@ class ExpressionParser extends LValParser { case types.parenL: return this.parseParenAndDistinguishExpression(canBeArrow); - case types.bracketL: + case types.bracketBarL: + case types.bracketHashL: { - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - node = this.startNode(); - this.next(); - node.elements = this.parseExprList(types.bracketR, true, refShorthandDefaultPos); + return this.parseArrayLike(this.state.type === types.bracketBarL ? types.bracketBarR : types.bracketR, false, true, refExpressionErrors); + } - if (!this.state.maybeInArrowParameters) { - this.toReferencedList(node.elements); - } + case types.bracketL: + { + return this.parseArrayLike(types.bracketR, true, false, refExpressionErrors); + } - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return this.finishNode(node, "ArrayExpression"); + case types.braceBarL: + case types.braceHashL: + { + return this.parseObjectLike(this.state.type === types.braceBarL ? types.braceBarR : types.braceR, false, true, refExpressionErrors); } case types.braceL: { - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - const ret = this.parseObj(false, refShorthandDefaultPos); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return ret; + return this.parseObjectLike(types.braceR, false, false, refExpressionErrors); } case types._function: - return this.parseFunctionExpression(); + return this.parseFunctionOrFunctionSent(); case types.at: this.parseDecorators(); @@ -8798,7 +10476,7 @@ class ExpressionParser extends LValParser { return this.parseClass(node, false); case types._new: - return this.parseNew(); + return this.parseNewOrNewTarget(); case types.backQuote: return this.parseTemplate(false); @@ -8813,7 +10491,7 @@ class ExpressionParser extends LValParser { if (callee.type === "MemberExpression") { return this.finishNode(node, "BindExpression"); } else { - throw this.raise(callee.start, "Binding should be performed on object property."); + throw this.raise(callee.start, ErrorMessages.UnsupportedBind); } } @@ -8823,17 +10501,46 @@ class ExpressionParser extends LValParser { node = this.startNode(); if (this.getPluginOption("pipelineOperator", "proposal") !== "smart") { - this.raise(node.start, "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option."); + this.raise(node.start, ErrorMessages.PrimaryTopicRequiresSmartPipeline); } this.next(); - if (this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) { - this.registerTopicReference(); - return this.finishNode(node, "PipelinePrimaryTopicReference"); + 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(node.id.name, node.start); + } else if (this.hasPlugin("privateIn")) { + this.raise(this.state.start, ErrorMessages.PrivateInExpectedIn, node.id.name); } else { - throw this.raise(node.start, `Topic reference was used in a lexical context without topic binding`); + 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"]); + } } } @@ -8842,6 +10549,49 @@ class ExpressionParser extends LValParser { } } + 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); @@ -8849,11 +10599,16 @@ class ExpressionParser extends LValParser { return this.finishNode(node, "BooleanLiteral"); } - parseMaybePrivateName() { + 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"); @@ -8864,13 +10619,13 @@ class ExpressionParser extends LValParser { } } - parseFunctionExpression() { + parseFunctionOrFunctionSent() { const node = this.startNode(); - let meta = this.startNode(); this.next(); - meta = this.createIdentifier(meta, "function"); - if (this.scope.inGenerator && this.eat(types.dot)) { + if (this.prodParam.hasYield && this.match(types.dot)) { + const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); + this.next(); return this.parseMetaProperty(node, meta, "sent"); } @@ -8892,7 +10647,7 @@ class ExpressionParser extends LValParser { node.property = this.parseIdentifier(true); if (node.property.name !== propertyName || containsEsc) { - this.raise(node.property.start, `The only valid meta property for ${meta.name} is ${meta.name}.${propertyName}`); + this.raise(node.property.start, ErrorMessages.UnsupportedMetaProperty, meta.name, propertyName); } return this.finishNode(node, "MetaProperty"); @@ -8900,21 +10655,18 @@ class ExpressionParser extends LValParser { parseImportMetaProperty(node) { const id = this.createIdentifier(this.startNodeAtNode(node), "import"); - this.expect(types.dot); + this.next(); if (this.isContextual("meta")) { - this.expectPlugin("importMeta"); - } else if (!this.hasPlugin("importMeta")) { - this.raise(id.start, `Dynamic imports require a parameter: import('a.js')`); - } + if (!this.inModule) { + this.raiseWithData(id.start, { + code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" + }, ErrorMessages.ImportMetaOutsideModule); + } - if (!this.inModule) { - this.raise(id.start, `import.meta may appear only with 'sourceType: "module"'`, { - code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" - }); + this.sawUnambiguousESM = true; } - this.sawUnambiguousESM = true; return this.parseMetaProperty(node, id, "meta"); } @@ -8933,21 +10685,16 @@ class ExpressionParser extends LValParser { const startPos = this.state.start; const startLoc = this.state.startLoc; let val; - this.expect(types.parenL); + this.next(); + this.expressionScope.enter(newArrowHeadScope()); const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - const oldYieldPos = this.state.yieldPos; - const oldAwaitPos = this.state.awaitPos; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.maybeInArrowParameters = true; - this.state.yieldPos = 0; - this.state.awaitPos = 0; this.state.inFSharpPipelineDirectBody = false; const innerStartPos = this.state.start; const innerStartLoc = this.state.startLoc; const exprList = []; - const refShorthandDefaultPos = { - start: 0 - }; + const refExpressionErrors = new ExpressionErrors(); const refNeedsArrowPos = { start: 0 }; @@ -8972,39 +10719,28 @@ class ExpressionParser extends LValParser { const spreadNodeStartLoc = this.state.startLoc; spreadStart = this.state.start; exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc)); - this.checkCommaAfterRest(); + this.checkCommaAfterRest(41); break; } else { - exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos)); + exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem, refNeedsArrowPos)); } } - const innerEndPos = this.state.start; - const innerEndLoc = this.state.startLoc; + 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.checkYieldAwaitInDefaultParams(); - this.state.yieldPos = oldYieldPos; - this.state.awaitPos = oldAwaitPos; - - for (let _i = 0; _i < exprList.length; _i++) { - const param = exprList[_i]; - - if (param.extra && param.extra.parenthesized) { - this.unexpected(param.extra.parenStart); - } - } - + this.expressionScope.validateAsPattern(); + this.expressionScope.exit(); this.parseArrowExpression(arrowNode, exprList, false); return arrowNode; } - this.state.yieldPos = oldYieldPos || this.state.yieldPos; - this.state.awaitPos = oldAwaitPos || this.state.awaitPos; + this.expressionScope.exit(); if (!exprList.length) { this.unexpected(this.state.lastTokStart); @@ -9012,11 +10748,7 @@ class ExpressionParser extends LValParser { if (optionalCommaStart) this.unexpected(optionalCommaStart); if (spreadStart) this.unexpected(spreadStart); - - if (refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - + this.checkExpressionErrors(refExpressionErrors, true); if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start); this.toReferencedListDeep(exprList, true); @@ -9054,15 +10786,17 @@ class ExpressionParser extends LValParser { return node; } - parseNew() { + parseNewOrNewTarget() { const node = this.startNode(); - const meta = this.parseIdentifier(true); + this.next(); - if (this.eat(types.dot)) { + 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.state.inClassProperty) { - let error = "new.target can only be used in functions"; + if (!this.scope.inNonArrowFunction && !this.scope.inClass) { + let error = ErrorMessages.UnexpectedNewTarget; if (this.hasPlugin("classProperties")) { error += " or class properties"; @@ -9074,14 +10808,18 @@ class ExpressionParser extends LValParser { return metaProp; } + return this.parseNew(node); + } + + parseNew(node) { node.callee = this.parseNoCallExpr(); if (node.callee.type === "Import") { - this.raise(node.callee.start, "Cannot use new with import(...)"); + this.raise(node.callee.start, ErrorMessages.ImportCallNotNewExpression); } else if (node.callee.type === "OptionalMemberExpression" || node.callee.type === "OptionalCallExpression") { - this.raise(this.state.lastTokEnd, "constructors in/after an Optional Chain are not allowed"); + this.raise(this.state.lastTokEnd, ErrorMessages.OptionalChainingNoNew); } else if (this.eat(types.questionDot)) { - this.raise(this.state.start, "constructors in/after an Optional Chain are not allowed"); + this.raise(this.state.start, ErrorMessages.OptionalChainingNoNew); } this.parseNewArguments(node); @@ -9103,9 +10841,7 @@ class ExpressionParser extends LValParser { if (this.state.value === null) { if (!isTagged) { - this.raise(this.state.invalidTemplateEscapePosition || 0, "Invalid escape sequence in template"); - } else { - this.state.invalidTemplateEscapePosition = null; + this.raise(this.state.start + 1, ErrorMessages.InvalidEscapeSequenceTemplate); } } @@ -9127,7 +10863,7 @@ class ExpressionParser extends LValParser { while (!curElt.tail) { this.expect(types.dollarBraceL); - node.expressions.push(this.parseExpression()); + node.expressions.push(this.parseTemplateSubstitution()); this.expect(types.braceR); node.quasis.push(curElt = this.parseTemplateElement(isTagged)); } @@ -9136,23 +10872,44 @@ class ExpressionParser extends LValParser { return this.finishNode(node, "TemplateLiteral"); } - parseObj(isPattern, refShorthandDefaultPos) { + 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.eat(types.braceR)) { + while (!this.match(close)) { if (first) { first = false; } else { this.expect(types.comma); - if (this.eat(types.braceR)) break; + + 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); } - const prop = this.parseObjectMember(isPattern, refShorthandDefaultPos); - if (!isPattern) this.checkPropClash(prop, propHash); + if (isRecord && prop.type !== "ObjectProperty" && prop.type !== "SpreadElement") { + this.raise(prop.start, ErrorMessages.InvalidRecordProperty); + } if (prop.shorthand) { this.addExtra(prop, "shorthand", true); @@ -9161,29 +10918,41 @@ class ExpressionParser extends LValParser { node.properties.push(prop); } - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); + 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); } - isAsyncProp(prop) { - return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.match(types.name) || this.match(types.num) || this.match(types.string) || this.match(types.bracketL) || this.state.type.keyword || this.match(types.star)) && !this.hasPrecedingLineBreak(); + maybeAsyncOrAccessorProp(prop) { + return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(types.bracketL) || this.match(types.star)); } - parseObjectMember(isPattern, refShorthandDefaultPos) { + parsePropertyDefinition(isPattern, refExpressionErrors) { let decorators = []; if (this.match(types.at)) { if (this.hasPlugin("decorators")) { - this.raise(this.state.start, "Stage 2 decorators disallow object literal property decorators"); - } else { - while (this.match(types.at)) { - decorators.push(this.parseDecorator()); - } + 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; @@ -9193,7 +10962,7 @@ class ExpressionParser extends LValParser { if (isPattern) { this.next(); prop.argument = this.parseIdentifier(); - this.checkCommaAfterRest(); + this.checkCommaAfterRest(125); return this.finishNode(prop, "RestElement"); } @@ -9207,7 +10976,7 @@ class ExpressionParser extends LValParser { prop.method = false; - if (isPattern || refShorthandDefaultPos) { + if (isPattern || refExpressionErrors) { startPos = this.state.start; startLoc = this.state.startLoc; } @@ -9217,79 +10986,94 @@ class ExpressionParser extends LValParser { } const containsEsc = this.state.containsEsc; - this.parsePropertyName(prop); + const key = this.parsePropertyName(prop, false); - if (!isPattern && !containsEsc && !isGenerator && this.isAsyncProp(prop)) { - isAsync = true; - isGenerator = this.eat(types.star); - this.parsePropertyName(prop); - } else { - isAsync = 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, refShorthandDefaultPos, containsEsc); + this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); return prop; } - isGetterOrSetterMethod(prop, isPattern) { - return !isPattern && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.match(types.string) || this.match(types.num) || this.match(types.bracketL) || this.match(types.name) || !!this.state.type.keyword); - } - 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 (method.params.length !== paramCount) { + if (params.length !== paramCount) { if (method.kind === "get") { - this.raise(start, "getter must not have any formal parameters"); + this.raise(start, ErrorMessages.BadGetterArity); } else { - this.raise(start, "setter must have exactly one formal parameter"); + this.raise(start, ErrorMessages.BadSetterArity); } } - if (method.kind === "set" && method.params[method.params.length - 1].type === "RestElement") { - this.raise(start, "setter function argument must not be a rest parameter"); + 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, containsEsc) { + 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"); } - - if (!containsEsc && this.isGetterOrSetterMethod(prop, isPattern)) { - if (isGenerator || isAsync) this.unexpected(); - prop.kind = prop.key.name; - this.parsePropertyName(prop); - this.parseMethod(prop, false, false, false, false, "ObjectMethod"); - this.checkGetterSetterParams(prop); - return prop; - } } - parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos) { + 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.parseMaybeAssign(false, refShorthandDefaultPos); + 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, true); + 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) && refShorthandDefaultPos) { - if (!refShorthandDefaultPos.start) { - refShorthandDefaultPos.start = this.state.start; + } 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()); @@ -9302,21 +11086,21 @@ class ExpressionParser extends LValParser { } } - parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc) { - const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos); + 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) { + parsePropertyName(prop, isPrivateNameAllowed) { if (this.eat(types.bracketL)) { prop.computed = true; - prop.key = this.parseMaybeAssign(); + 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.parseExprAtom() : this.parseMaybePrivateName(); + prop.key = this.match(types.num) || this.match(types.string) || this.match(types.bigint) || this.match(types.decimal) ? this.parseExprAtom() : this.parseMaybePrivateName(isPrivateNameAllowed); if (prop.key.type !== "PrivateName") { prop.computed = false; @@ -9335,59 +11119,59 @@ class ExpressionParser extends LValParser { } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { - const oldYieldPos = this.state.yieldPos; - const oldAwaitPos = this.state.awaitPos; - this.state.yieldPos = 0; - this.state.awaitPos = 0; this.initFunction(node, isAsync); node.generator = !!isGenerator; const allowModifiers = isConstructor; - this.scope.enter(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + 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.checkYieldAwaitInDefaultParams(); this.parseFunctionBodyAndFinish(node, type, true); + this.prodParam.exit(); this.scope.exit(); - this.state.yieldPos = oldYieldPos; - this.state.awaitPos = oldAwaitPos; return node; } - parseArrowExpression(node, params, isAsync) { - this.scope.enter(functionFlags(isAsync, false) | SCOPE_ARROW); + 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; - const oldYieldPos = this.state.yieldPos; - const oldAwaitPos = this.state.awaitPos; + + if (params) { + this.state.maybeInArrowParameters = true; + this.setArrowFunctionParameters(node, params, trailingCommaPos); + } + this.state.maybeInArrowParameters = false; - this.state.yieldPos = 0; - this.state.awaitPos = 0; - if (params) this.setArrowFunctionParameters(node, params); this.parseFunctionBody(node, true); + this.prodParam.exit(); this.scope.exit(); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - this.state.yieldPos = oldYieldPos; - this.state.awaitPos = oldAwaitPos; return this.finishNode(node, "ArrowFunctionExpression"); } - setArrowFunctionParameters(node, params) { - node.params = this.toAssignableList(params, true, "arrow function parameters"); - } - - isStrictBody(node) { - const isBlockStatement = node.body.type === "BlockStatement"; - - if (isBlockStatement && node.body.directives.length) { - for (let _i2 = 0, _node$body$directives = node.body.directives; _i2 < _node$body$directives.length; _i2++) { - const directive = _node$body$directives[_i2]; - - if (directive.value.value === "use strict") { - return true; - } - } - } - - return false; + setArrowFunctionParameters(node, params, trailingCommaPos) { + node.params = this.toAssignableList(params, trailingCommaPos, false); } parseFunctionBodyAndFinish(node, type, isMethod = false) { @@ -9397,41 +11181,35 @@ class ExpressionParser extends LValParser { parseFunctionBody(node, allowExpression, isMethod = false) { const isExpression = allowExpression && !this.match(types.braceL); - const oldStrict = this.state.strict; - let useStrict = false; - const oldInParameters = this.state.inParameters; - this.state.inParameters = false; + this.expressionScope.enter(newExpressionScope()); if (isExpression) { node.body = this.parseMaybeAssign(); - this.checkParams(node, false, allowExpression); + this.checkParams(node, false, allowExpression, false); } else { - const nonSimple = !this.isSimpleParamList(node.params); - - if (!oldStrict || nonSimple) { - useStrict = this.strictDirective(this.state.end); + 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 (useStrict && nonSimple) { + if (hasStrictModeDirective && nonSimple) { const errorPos = (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.end : node.start; - this.raise(errorPos, "Illegal 'use strict' directive in function with non-simple parameter list"); + this.raise(errorPos, ErrorMessages.IllegalLanguageModeDirective); } - } - - const oldLabels = this.state.labels; - this.state.labels = []; - if (useStrict) this.state.strict = true; - this.checkParams(node, !oldStrict && !useStrict && !allowExpression && !isMethod && !nonSimple, allowExpression); - node.body = this.parseBlock(true, false); - this.state.labels = oldLabels; - } - this.state.inParameters = oldInParameters; + 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, BIND_OUTSIDE, undefined, "function name"); + 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; } - - this.state.strict = oldStrict; } isSimpleParamList(params) { @@ -9442,15 +11220,16 @@ class ExpressionParser extends LValParser { return true; } - checkParams(node, allowDuplicates, isArrowFunction) { - const nameHash = Object.create(null); + checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { + const checkClashes = new Set(); - for (let i = 0; i < node.params.length; i++) { - this.checkLVal(node.params[i], BIND_VAR, allowDuplicates ? null : nameHash, "function paramter list"); + 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, refShorthandDefaultPos) { + parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { const elts = []; let first = true; @@ -9459,36 +11238,48 @@ class ExpressionParser extends LValParser { first = false; } else { this.expect(types.comma); - if (this.eat(close)) break; + + if (this.match(close)) { + if (nodeForExtra) { + this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart); + } + + this.next(); + break; + } } - elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos)); + elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors)); } return elts; } - parseExprListItem(allowEmpty, refShorthandDefaultPos, refNeedsArrowPos, allowPlaceholder) { + parseExprListItem(allowEmpty, refExpressionErrors, refNeedsArrowPos, allowPlaceholder) { let elt; - if (allowEmpty && this.match(types.comma)) { + 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(refShorthandDefaultPos, refNeedsArrowPos), spreadNodeStartPos, spreadNodeStartLoc); + 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, "Unexpected argument placeholder"); + this.raise(this.state.start, ErrorMessages.UnexpectedArgumentPlaceholder); } const node = this.startNode(); this.next(); elt = this.finishNode(node, "ArgumentPlaceholder"); } else { - elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos); + elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem, refNeedsArrowPos); } return elt; @@ -9508,21 +11299,28 @@ class ExpressionParser extends LValParser { parseIdentifierName(pos, liberal) { let name; + const { + start, + type + } = this.state; - if (this.match(types.name)) { + if (type === types.name) { name = this.state.value; - } else if (this.state.type.keyword) { - name = this.state.type.keyword; + } else if (type.keyword) { + name = type.keyword; + const curContext = this.curContext(); - if ((name === "class" || name === "function") && (this.state.lastTokEnd !== this.state.lastTokStart + 1 || this.input.charCodeAt(this.state.lastTokStart) !== 46)) { + 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.checkReservedWord(name, this.state.start, !!this.state.type.keyword, false); + if (liberal) { + this.state.type = types.name; + } else { + this.checkReservedWord(name, start, !!type.keyword, false); } this.next(); @@ -9530,47 +11328,67 @@ class ExpressionParser extends LValParser { } checkReservedWord(word, startLoc, checkKeywords, isBinding) { - if (this.scope.inGenerator && word === "yield") { - this.raise(startLoc, "Can not use 'yield' as identifier inside a generator"); + if (this.prodParam.hasYield && word === "yield") { + this.raise(startLoc, ErrorMessages.YieldBindingIdentifier); + return; } - if (this.scope.inAsync && word === "await") { - this.raise(startLoc, "Can not use 'await' as identifier inside an async function"); + if (word === "await") { + if (this.prodParam.hasAwait) { + this.raise(startLoc, ErrorMessages.AwaitBindingIdentifier); + return; + } else { + this.expressionScope.recordAsyncArrowParametersError(startLoc, ErrorMessages.AwaitBindingIdentifier); + } } - if (this.state.inClassProperty && word === "arguments") { - this.raise(startLoc, "'arguments' is not allowed in class field initializer"); + if (this.scope.inClass && !this.scope.inNonArrowFunction && word === "arguments") { + this.raise(startLoc, ErrorMessages.ArgumentsInClass); + return; } if (checkKeywords && isKeyword(word)) { - this.raise(startLoc, `Unexpected keyword '${word}'`); + this.raise(startLoc, ErrorMessages.UnexpectedKeyword, word); + return; } const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; if (reservedTest(word, this.inModule)) { - if (!this.scope.inAsync && word === "await") { - this.raise(startLoc, "Can not use keyword 'await' outside an async function"); + if (!this.prodParam.hasAwait && word === "await") { + this.raise(startLoc, this.hasPlugin("topLevelAwait") ? ErrorMessages.AwaitNotInAsyncContext : ErrorMessages.AwaitNotInAsyncFunction); + } else { + this.raise(startLoc, ErrorMessages.UnexpectedReservedWord, word); } - - this.raise(startLoc, `Unexpected reserved word '${word}'`); } } - parseAwait() { - if (!this.state.awaitPos) { - this.state.awaitPos = this.state.start; + isAwaitAllowed() { + if (this.scope.inFunction) return this.prodParam.hasAwait; + if (this.options.allowAwaitOutsideFunction) return true; + + if (this.hasPlugin("topLevelAwait")) { + return this.inModule && this.prodParam.hasAwait; } + return false; + } + + parseAwait() { const node = this.startNode(); this.next(); + this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.AwaitExpressionFormalParameter); - if (this.state.inParameters) { - this.raise(node.start, "await is not allowed in async function parameters"); + if (this.eat(types.star)) { + this.raise(node.start, ErrorMessages.ObsoleteAwaitStar); } - if (this.match(types.star)) { - this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead."); + if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) { + if (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)) { + this.ambiguousScriptDifferentAst = true; + } else { + this.sawUnambiguousESM = true; + } } if (!this.state.soloAwait) { @@ -9580,25 +11398,17 @@ class ExpressionParser extends LValParser { return this.finishNode(node, "AwaitExpression"); } - parseYield(noIn) { - if (!this.state.yieldPos) { - this.state.yieldPos = this.state.start; - } - + parseYield() { const node = this.startNode(); - - if (this.state.inParameters) { - this.raise(node.start, "yield is not allowed in generator parameters"); - } - + this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.YieldInParameter); this.next(); - if (this.match(types.semi) || !this.match(types.star) && !this.state.type.startsExpr || this.canInsertSemicolon()) { + 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(noIn); + node.argument = this.parseMaybeAssign(); } return this.finishNode(node, "YieldExpression"); @@ -9607,61 +11417,39 @@ class ExpressionParser extends LValParser { checkPipelineAtInfixOperator(left, leftStartPos) { if (this.getPluginOption("pipelineOperator", "proposal") === "smart") { if (left.type === "SequenceExpression") { - throw this.raise(leftStartPos, `Pipeline head should not be a comma-separated sequence expression`); + this.raise(leftStartPos, ErrorMessages.PipelineHeadSequenceExpression); } } } parseSmartPipelineBody(childExpression, startPos, startLoc) { - const pipelineStyle = this.checkSmartPipelineBodyStyle(childExpression); - this.checkSmartPipelineBodyEarlyErrors(childExpression, pipelineStyle, startPos); - return this.parseSmartPipelineBodyInStyle(childExpression, pipelineStyle, startPos, startLoc); + this.checkSmartPipelineBodyEarlyErrors(childExpression, startPos); + return this.parseSmartPipelineBodyInStyle(childExpression, startPos, startLoc); } - checkSmartPipelineBodyEarlyErrors(childExpression, pipelineStyle, startPos) { + checkSmartPipelineBodyEarlyErrors(childExpression, startPos) { if (this.match(types.arrow)) { - throw this.raise(this.state.start, `Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized`); - } else if (pipelineStyle === "PipelineTopicExpression" && childExpression.type === "SequenceExpression") { - throw this.raise(startPos, `Pipeline body may not be a comma-separated sequence expression`); + throw this.raise(this.state.start, ErrorMessages.PipelineBodyNoArrow); + } else if (childExpression.type === "SequenceExpression") { + this.raise(startPos, ErrorMessages.PipelineBodySequenceExpression); } } - parseSmartPipelineBodyInStyle(childExpression, pipelineStyle, startPos, startLoc) { + parseSmartPipelineBodyInStyle(childExpression, startPos, startLoc) { const bodyNode = this.startNodeAt(startPos, startLoc); + const isSimpleReference = this.isSimpleReference(childExpression); - switch (pipelineStyle) { - case "PipelineBareFunction": - bodyNode.callee = childExpression; - break; - - case "PipelineBareConstructor": - bodyNode.callee = childExpression.callee; - break; - - case "PipelineBareAwaitedFunction": - bodyNode.callee = childExpression.argument; - break; - - case "PipelineTopicExpression": - if (!this.topicReferenceWasUsedInCurrentTopicContext()) { - throw this.raise(startPos, `Pipeline is in topic style but does not use topic reference`); - } - - bodyNode.expression = childExpression; - break; - - default: - throw this.raise(startPos, `Unknown pipeline style ${pipelineStyle}`); - } - - return this.finishNode(bodyNode, pipelineStyle); - } - - checkSmartPipelineBodyStyle(expression) { - switch (expression.type) { - default: - return this.isSimpleReference(expression) ? "PipelineBareFunction" : "PipelineTopicExpression"; + 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) { @@ -9716,6 +11504,40 @@ class ExpressionParser extends LValParser { } } + 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; } @@ -9728,13 +11550,13 @@ class ExpressionParser extends LValParser { return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; } - parseFSharpPipelineBody(prec, noIn) { + 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, noIn); + const ret = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return ret; } @@ -9751,6 +11573,7 @@ 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) { program.sourceType = this.options.sourceType; @@ -9761,13 +11584,13 @@ class StatementParser extends ExpressionParser { 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, `Export '${name}' is not defined`); + this.raise(pos, ErrorMessages.ModuleExportUndefined, name); } } file.program = this.finishNode(program, "Program"); file.comments = this.state.comments; - if (this.options.tokens) file.tokens = this.state.tokens; + if (this.options.tokens) file.tokens = this.tokens; return this.finishNode(file, "File"); } @@ -9799,9 +11622,7 @@ class StatementParser extends ExpressionParser { return false; } - skipWhiteSpace.lastIndex = this.state.pos; - const skip = skipWhiteSpace.exec(this.input); - const next = this.state.pos + skip[0].length; + const next = this.nextTokenStart(); const nextCh = this.input.charCodeAt(next); if (nextCh === 91) return true; if (context) return false; @@ -9854,13 +11675,13 @@ class StatementParser extends ExpressionParser { return this.parseForStatement(node); case types._function: - if (this.lookahead().type === types.dot) break; + if (this.lookaheadCharCode() === 46) break; if (context) { if (this.state.strict) { - this.raise(this.state.start, "In strict mode code, functions can only be declared at top level or inside a block"); + this.raise(this.state.start, ErrorMessages.StrictFunction); } else if (context !== "if" && context !== "label") { - this.raise(this.state.start, "In non-strict mode code, functions can only be declared at top level, " + "inside a block, or as the body of an if statement"); + this.raise(this.state.start, ErrorMessages.SloppyFunction); } } @@ -9890,7 +11711,7 @@ class StatementParser extends ExpressionParser { kind = kind || this.state.value; if (context && kind !== "var") { - this.unexpected(this.state.start, "Lexical declaration cannot appear in a single-statement context"); + this.raise(this.state.start, ErrorMessages.UnexpectedLexicalDeclaration); } return this.parseVarStatement(node, kind); @@ -9907,17 +11728,19 @@ class StatementParser extends ExpressionParser { case types.semi: return this.parseEmptyStatement(node); - case types._export: case types._import: { - const nextToken = this.lookahead(); + const nextTokenCharCode = this.lookaheadCharCode(); - if (nextToken.type === types.parenL || nextToken.type === types.dot) { - break; - } + if (nextTokenCharCode === 40 || nextTokenCharCode === 46) { + break; + } + } + case types._export: + { if (!this.options.allowImportExportEverywhere && !topLevel) { - this.raise(this.state.start, "'import' and 'export' may only appear at the top level"); + this.raise(this.state.start, ErrorMessages.UnexpectedImportExport); } this.next(); @@ -9945,7 +11768,7 @@ class StatementParser extends ExpressionParser { { if (this.isAsyncFunction()) { if (context) { - this.unexpected(null, "Async functions can only be declared at the top level or inside a block"); + this.raise(this.state.start, ErrorMessages.AsyncFunctionInSingleStatementContext); } this.next(); @@ -9966,9 +11789,9 @@ class StatementParser extends ExpressionParser { assertModuleNodeAllowed(node) { if (!this.options.allowImportExportEverywhere && !this.inModule) { - this.raise(node.start, `'import' and 'export' may appear only with 'sourceType: "module"'`, { + this.raiseWithData(node.start, { code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" - }); + }, ErrorMessages.ImportOutsideModule); } } @@ -10000,10 +11823,10 @@ class StatementParser extends ExpressionParser { } if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.raise(this.state.start, "Using the export keyword between a decorator and a class is not allowed. " + "Please use `export @dec class` instead."); + this.raise(this.state.start, ErrorMessages.DecoratorExportClass); } } else if (!this.canHaveLeadingDecorator()) { - this.raise(this.state.start, "Leading decorators must be attached to a class declaration"); + throw this.raise(this.state.start, ErrorMessages.UnexpectedLeadingDecorator); } } @@ -10083,7 +11906,7 @@ class StatementParser extends ExpressionParser { } if (i === this.state.labels.length) { - this.raise(node.start, "Unsyntactic " + keyword); + this.raise(node.start, ErrorMessages.IllegalBreakContinue, keyword); } } @@ -10116,7 +11939,7 @@ class StatementParser extends ExpressionParser { this.state.labels.push(loopLabel); let awaitAt = -1; - if ((this.scope.inAsync || !this.scope.inFunction && this.options.allowAwaitOutsideFunction) && this.eatContextual("await")) { + if (this.isAwaitAllowed() && this.eatContextual("await")) { awaitAt = this.state.lastTokStart; } @@ -10151,18 +11974,16 @@ class StatementParser extends ExpressionParser { return this.parseFor(node, init); } - const refShorthandDefaultPos = { - start: 0 - }; - const init = this.parseExpression(true, refShorthandDefaultPos); + 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.toAssignable(init, undefined, description); - this.checkLVal(init, undefined, undefined, description); + this.checkLVal(init, description); return this.parseForIn(node, init, awaitAt); - } else if (refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); + } else { + this.checkExpressionErrors(refExpressionErrors, true); } if (awaitAt > -1) { @@ -10186,8 +12007,8 @@ class StatementParser extends ExpressionParser { } parseReturnStatement(node) { - if (!this.scope.inFunction && !this.options.allowReturnOutsideFunction) { - this.raise(this.state.start, "'return' outside of function"); + if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) { + this.raise(this.state.start, ErrorMessages.IllegalReturn); } this.next(); @@ -10223,7 +12044,7 @@ class StatementParser extends ExpressionParser { cur.test = this.parseExpression(); } else { if (sawDefault) { - this.raise(this.state.lastTokStart, "Multiple default clauses"); + this.raise(this.state.lastTokStart, ErrorMessages.MultipleDefaultsInSwitch); } sawDefault = true; @@ -10250,8 +12071,8 @@ class StatementParser extends ExpressionParser { parseThrowStatement(node) { this.next(); - if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) { - this.raise(this.state.lastTokEnd, "Illegal newline after throw"); + if (this.hasPrecedingLineBreak()) { + this.raise(this.state.lastTokEnd, ErrorMessages.NewlineAfterThrow); } node.argument = this.parseExpression(); @@ -10259,6 +12080,14 @@ class StatementParser extends ExpressionParser { 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(); @@ -10270,10 +12099,7 @@ class StatementParser extends ExpressionParser { if (this.match(types.parenL)) { this.expect(types.parenL); - clause.param = this.parseBindingAtom(); - const simple = clause.param.type === "Identifier"; - this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLVal(clause.param, BIND_LEXICAL, null, "catch clause"); + clause.param = this.parseCatchClauseParam(); this.expect(types.parenR); } else { clause.param = null; @@ -10288,7 +12114,7 @@ class StatementParser extends ExpressionParser { node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { - this.raise(node.start, "Missing catch or finally clause"); + this.raise(node.start, ErrorMessages.NoCatchOrFinally); } return this.finishNode(node, "TryStatement"); @@ -10312,7 +12138,7 @@ class StatementParser extends ExpressionParser { parseWithStatement(node) { if (this.state.strict) { - this.raise(this.state.start, "'with' in strict mode"); + this.raise(this.state.start, ErrorMessages.StrictWith); } this.next(); @@ -10331,7 +12157,7 @@ class StatementParser extends ExpressionParser { const label = _this$state$labels[_i2]; if (label.name === maybeName) { - this.raise(expr.start, `Label '${maybeName}' is already declared`); + this.raise(expr.start, ErrorMessages.LabelRedeclaration, maybeName); } } @@ -10365,7 +12191,7 @@ class StatementParser extends ExpressionParser { return this.finishNode(node, "ExpressionStatement"); } - parseBlock(allowDirectives = false, createNewLexicalScope = true) { + parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { const node = this.startNode(); this.expect(types.braceL); @@ -10373,7 +12199,7 @@ class StatementParser extends ExpressionParser { this.scope.enter(SCOPE_OTHER); } - this.parseBlockBody(node, allowDirectives, false, types.braceR); + this.parseBlockBody(node, allowDirectives, false, types.braceR, afterBlockParse); if (createNewLexicalScope) { this.scope.exit(); @@ -10386,20 +12212,21 @@ class StatementParser extends ExpressionParser { return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; } - parseBlockBody(node, allowDirectives, topLevel, end) { + parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { const body = node.body = []; const directives = node.directives = []; - this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end); + this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); } - parseBlockOrModuleBlockBody(body, directives, topLevel, end) { + parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { + const octalPositions = []; + const oldStrict = this.state.strict; + let hasStrictModeDirective = false; let parsedNonDirective = false; - let oldStrict; - let octalPosition; - while (!this.eat(end)) { - if (!parsedNonDirective && this.state.containsOctal && !octalPosition) { - octalPosition = this.state.octalPosition; + while (!this.match(end)) { + if (!parsedNonDirective && this.state.octalPositions.length) { + octalPositions.push(...this.state.octalPositions); } const stmt = this.parseStatement(null, topLevel); @@ -10408,13 +12235,9 @@ class StatementParser extends ExpressionParser { const directive = this.stmtToDirective(stmt); directives.push(directive); - if (oldStrict === undefined && directive.value.value === "use strict") { - oldStrict = this.state.strict; + if (!hasStrictModeDirective && directive.value.value === "use strict") { + hasStrictModeDirective = true; this.setStrict(true); - - if (octalPosition) { - this.raise(octalPosition, "Octal literal in strict mode"); - } } continue; @@ -10424,9 +12247,22 @@ class StatementParser extends ExpressionParser { body.push(stmt); } - if (oldStrict === false) { + if (this.state.strict && octalPositions.length) { + for (let _i3 = 0; _i3 < octalPositions.length; _i3++) { + const pos = octalPositions[_i3]; + this.raise(pos, ErrorMessages.StrictOctalLiteral); + } + } + + if (afterBlockParse) { + afterBlockParse.call(this, hasStrictModeDirective); + } + + if (!oldStrict) { this.setStrict(false); } + + this.next(); } parseFor(node, init) { @@ -10453,13 +12289,13 @@ class StatementParser extends ExpressionParser { } 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, `${isForIn ? "for-in" : "for-of"} loop variable declaration may not have an initializer`); + this.raise(init.start, ErrorMessages.ForInOfLoopInitializer, isForIn ? "for-in" : "for-of"); } else if (init.type === "AssignmentPattern") { - this.raise(init.start, "Invalid left-hand side in for-loop"); + this.raise(init.start, ErrorMessages.InvalidLhs, "for-loop"); } node.left = init; - node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); this.expect(types.parenR); node.body = this.withTopicForbiddingContext(() => this.parseStatement("for")); this.scope.exit(); @@ -10477,14 +12313,14 @@ class StatementParser extends ExpressionParser { this.parseVarId(decl, kind); if (this.eat(types.eq)) { - decl.init = this.parseMaybeAssign(isFor); + decl.init = isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); } else { if (kind === "const" && !(this.match(types._in) || this.isContextual("of"))) { if (!isTypescript) { - this.unexpected(); + 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, "Complex binding patterns require an initialization value"); + this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, "Complex binding patterns"); } decl.init = null; @@ -10499,7 +12335,7 @@ class StatementParser extends ExpressionParser { parseVarId(decl, kind) { decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, "variable declaration"); + this.checkLVal(decl.id, "variable declaration", kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, kind !== "var"); } parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) { @@ -10509,7 +12345,7 @@ class StatementParser extends ExpressionParser { this.initFunction(node, isAsync); if (this.match(types.star) && isHangingStatement) { - this.unexpected(this.state.start, "Generators can only be declared at the top level or inside a block"); + this.raise(this.state.start, ErrorMessages.GeneratorInSingleStatementContext); } node.generator = this.eat(types.star); @@ -10518,31 +12354,27 @@ class StatementParser extends ExpressionParser { node.id = this.parseFunctionId(requireId); } - const oldInClassProperty = this.state.inClassProperty; - const oldYieldPos = this.state.yieldPos; - const oldAwaitPos = this.state.awaitPos; - this.state.inClassProperty = false; - this.state.yieldPos = 0; - this.state.awaitPos = 0; - this.scope.enter(functionFlags(node.async, node.generator)); + 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); + this.parseFunctionParams(node, false); this.withTopicForbiddingContext(() => { this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); }); + this.prodParam.exit(); this.scope.exit(); if (isStatement && !isHangingStatement) { - this.checkFunctionStatementId(node); + this.registerFunctionStatementId(node); } - this.state.inClassProperty = oldInClassProperty; - this.state.yieldPos = oldYieldPos; - this.state.awaitPos = oldAwaitPos; + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return node; } @@ -10551,17 +12383,15 @@ class StatementParser extends ExpressionParser { } parseFunctionParams(node, allowModifiers) { - const oldInParameters = this.state.inParameters; - this.state.inParameters = true; this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, allowModifiers); - this.state.inParameters = oldInParameters; - this.checkYieldAwaitInDefaultParams(); + this.expressionScope.enter(newParameterDeclarationScope()); + node.params = this.parseBindingList(types.parenR, 41, false, allowModifiers); + this.expressionScope.exit(); } - checkFunctionStatementId(node) { + registerFunctionStatementId(node) { if (!node.id) return; - this.checkLVal(node.id, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, null, "function name"); + 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) { @@ -10571,8 +12401,7 @@ class StatementParser extends ExpressionParser { this.state.strict = true; this.parseClassId(node, isStatement, optionalId); this.parseClassSuper(node); - node.body = this.parseClassBody(!!node.superClass); - this.state.strict = oldStrict; + node.body = this.parseClassBody(!!node.superClass, oldStrict); return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); } @@ -10588,20 +12417,22 @@ class StatementParser extends ExpressionParser { return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor"); } - parseClassBody(constructorAllowsSuper) { - this.state.classLevel++; + parseClassBody(constructorAllowsSuper, oldStrict) { + this.classScope.enter(); const state = { - hadConstructor: false + constructorAllowsSuper, + hadConstructor: false, + hadStaticBlock: false }; let decorators = []; const classBody = this.startNode(); classBody.body = []; this.expect(types.braceL); this.withTopicForbiddingContext(() => { - while (!this.eat(types.braceR)) { + while (!this.match(types.braceR)) { if (this.eat(types.semi)) { if (decorators.length > 0) { - this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon"); + throw this.raise(this.state.lastTokEnd, ErrorMessages.DecoratorSemicolon); } continue; @@ -10620,55 +12451,65 @@ class StatementParser extends ExpressionParser { decorators = []; } - this.parseClassMember(classBody, member, state, constructorAllowsSuper); + this.parseClassMember(classBody, member, state); if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { - this.raise(member.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?"); + this.raise(member.start, ErrorMessages.DecoratorConstructor); } } }); + this.state.strict = oldStrict; + this.next(); if (decorators.length) { - this.raise(this.state.start, "You have trailing decorators with no method"); + throw this.raise(this.state.start, ErrorMessages.TrailingDecorator); } - this.state.classLevel--; + this.classScope.exit(); return this.finishNode(classBody, "ClassBody"); } - parseClassMember(classBody, member, state, constructorAllowsSuper) { - let isStatic = false; - const containsEsc = this.state.containsEsc; + 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; + } - if (this.match(types.name) && this.state.value === "static") { - const key = this.parseIdentifier(true); + return false; + } - 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; - } else if (this.isClassProperty()) { - const prop = member; - prop.computed = false; - prop.key = key; - prop.static = false; - classBody.body.push(this.parseClassProperty(prop)); + parseClassMember(classBody, member, state) { + const isStatic = this.isContextual("static"); + + if (isStatic) { + if (this.parseClassMemberFromModifier(classBody, member)) { return; - } else if (containsEsc) { - throw this.unexpected(); } - isStatic = true; + if (this.eat(types.braceL)) { + this.parseClassStaticBlock(classBody, member, state); + return; + } } - this.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper); + this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); } - parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) { + parseClassMemberWithIsStatic(classBody, member, state, isStatic) { const publicMethod = member; const privateMethod = member; const publicProp = member; @@ -10679,7 +12520,7 @@ class StatementParser extends ExpressionParser { if (this.eat(types.star)) { method.kind = "method"; - this.parseClassPropertyName(method); + this.parseClassElementName(method); if (method.key.type === "PrivateName") { this.pushClassPrivateMethod(classBody, privateMethod, true, false); @@ -10687,7 +12528,7 @@ class StatementParser extends ExpressionParser { } if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, "Constructor can't be a generator"); + this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsGenerator); } this.pushClassMethod(classBody, publicMethod, true, false, false, false); @@ -10695,9 +12536,10 @@ class StatementParser extends ExpressionParser { } const containsEsc = this.state.containsEsc; - const key = this.parseClassPropertyName(member); + const key = this.parseClassElementName(member); const isPrivate = key.type === "PrivateName"; const isSimple = key.type === "Identifier"; + const maybeQuestionTokenStart = this.state.start; this.parsePostMemberNameModifiers(publicMember); if (this.isClassMethod()) { @@ -10714,16 +12556,12 @@ class StatementParser extends ExpressionParser { if (isConstructor) { publicMethod.kind = "constructor"; - if (publicMethod.decorators) { - this.raise(publicMethod.start, "You can't attach decorators to a class constructor"); - } - if (state.hadConstructor && !this.hasPlugin("typescript")) { - this.raise(key.start, "Duplicate constructor in the same class"); + this.raise(key.start, ErrorMessages.DuplicateConstructor); } state.hadConstructor = true; - allowsDirectSuper = constructorAllowsSuper; + allowsDirectSuper = state.constructorAllowsSuper; } this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); @@ -10735,27 +12573,33 @@ class StatementParser extends ExpressionParser { } } 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.parseClassPropertyName(method); + this.parseClassElementName(method); + this.parsePostMemberNameModifiers(publicMember); if (method.key.type === "PrivateName") { this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); } else { if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, "Constructor can't be an async function"); + 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.parseClassPropertyName(publicMethod); + this.parseClassElementName(publicMethod); if (method.key.type === "PrivateName") { this.pushClassPrivateMethod(classBody, privateMethod, false, false); } else { if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, "Constructor can't have get/set modifier"); + this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAccessor); } this.pushClassMethod(classBody, publicMethod, false, false, false, false); @@ -10773,23 +12617,51 @@ class StatementParser extends ExpressionParser { } } - parseClassPropertyName(member) { - const key = this.parsePropertyName(member); + parseClassElementName(member) { + const key = this.parsePropertyName(member, true); if (!member.computed && member.static && (key.name === "prototype" || key.value === "prototype")) { - this.raise(key.start, "Classes may not have static property named prototype"); + this.raise(key.start, ErrorMessages.StaticPrototype); } if (key.type === "PrivateName" && key.id.name === "constructor") { - this.raise(key.start, "Classes may not have a private field named '#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_SUPER); + this.expressionScope.enter(newExpressionScope()); + 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.expressionScope.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 (this.isNonstaticConstructor(prop)) { - this.raise(prop.key.start, "Classes may not have a non-static field named 'constructor'"); + if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) { + this.raise(prop.key.start, ErrorMessages.ConstructorClassField); } classBody.body.push(this.parseClassProperty(prop)); @@ -10797,7 +12669,9 @@ class StatementParser extends ExpressionParser { pushClassPrivateProperty(classBody, prop) { this.expectPlugin("classPrivateProperties", prop.key.start); - classBody.body.push(this.parseClassPrivateProperty(prop)); + const node = this.parseClassPrivateProperty(prop); + classBody.body.push(node); + this.classScope.declarePrivateName(node.key.id.name, CLASS_ELEMENT_OTHER, node.key.start); } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { @@ -10806,59 +12680,52 @@ class StatementParser extends ExpressionParser { pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { this.expectPlugin("classPrivateMethods", method.key.start); - classBody.body.push(this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true)); + 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(node.key.id.name, kind, node.key.start); } parsePostMemberNameModifiers(methodOrProp) {} - parseAccessModifier() { - return undefined; - } - parseClassPrivateProperty(node) { - this.state.inClassProperty = true; - this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); - node.value = this.eat(types.eq) ? this.parseMaybeAssign() : null; + this.parseInitializer(node); this.semicolon(); - this.state.inClassProperty = false; - this.scope.exit(); return this.finishNode(node, "ClassPrivateProperty"); } parseClassProperty(node) { - if (!node.typeAnnotation) { - this.expectPlugin("classProperties"); - } - - this.state.inClassProperty = true; - this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); - - if (this.match(types.eq)) { + if (!node.typeAnnotation || this.match(types.eq)) { this.expectPlugin("classProperties"); - this.next(); - node.value = this.parseMaybeAssign(); - } else { - node.value = null; } + this.parseInitializer(node); this.semicolon(); - this.state.inClassProperty = false; - this.scope.exit(); return this.finishNode(node, "ClassProperty"); } - parseClassId(node, isStatement, optionalId) { + 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, BIND_CLASS, undefined, "class name"); + this.checkLVal(node.id, "class name", bindingType); } } else { if (optionalId || !isStatement) { node.id = null; } else { - this.unexpected(null, "A class name is required"); + this.unexpected(null, ErrorMessages.MissingClassName); } } } @@ -10929,10 +12796,9 @@ class StatementParser extends ExpressionParser { maybeParseExportNamespaceSpecifier(node) { if (this.isContextual("as")) { if (!node.specifiers) node.specifiers = []; - this.expectPlugin("exportNamespaceFrom"); const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc); this.next(); - specifier.exported = this.parseIdentifier(true); + specifier.exported = this.parseModuleExportName(); node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); return true; } @@ -10954,14 +12820,6 @@ class StatementParser extends ExpressionParser { maybeParseExportDeclaration(node) { if (this.shouldParseExportDeclaration()) { - if (this.isContextual("async")) { - const next = this.lookahead(); - - if (next.type !== types._function) { - this.unexpected(next.start, `Unexpected token, expected "function"`); - } - } - node.specifiers = []; node.source = null; node.declaration = this.parseExportDeclaration(node); @@ -10973,14 +12831,8 @@ class StatementParser extends ExpressionParser { isAsyncFunction() { if (!this.isContextual("async")) return false; - const { - pos - } = this.state; - skipWhiteSpace.lastIndex = pos; - const skip = skipWhiteSpace.exec(this.input); - if (!skip || !skip.length) return false; - const next = pos + skip[0].length; - return !lineBreak.test(this.input.slice(pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.length || !isIdentifierChar(this.input.charCodeAt(next + 8))); + const next = this.nextTokenStart(); + return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function"); } parseExportDefaultExpression() { @@ -10999,15 +12851,15 @@ class StatementParser extends ExpressionParser { return this.parseClass(expr, true, true); } else if (this.match(types.at)) { if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.unexpected(this.state.start, "Decorators must be placed *before* the 'export' keyword." + " You can set the 'decoratorsBeforeExport' option to false to use" + " the 'export @decorator class {}' syntax"); + 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()) { - return this.raise(this.state.start, "Only expressions, functions or classes are allowed as the `default` export."); + throw this.raise(this.state.start, ErrorMessages.UnsupportedDefaultExport); } else { - const res = this.parseMaybeAssign(); + const res = this.parseMaybeAssignAllowIn(); this.semicolon(); return res; } @@ -11019,21 +12871,48 @@ class StatementParser extends ExpressionParser { isExportDefaultSpecifier() { if (this.match(types.name)) { - return this.state.value !== "async" && this.state.value !== "let"; - } + 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 (!this.match(types._default)) { + 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 lookahead = this.lookahead(); - return lookahead.type === types.comma || lookahead.type === types.name && lookahead.value === "from"; + 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(); @@ -11051,7 +12930,7 @@ class StatementParser extends ExpressionParser { if (this.hasPlugin("decorators")) { if (this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.unexpected(this.state.start, "Decorators must be placed *before* the 'export' keyword." + " You can set the 'decoratorsBeforeExport' option to false to use" + " the 'export @decorator class {}' syntax"); + this.unexpected(this.state.start, ErrorMessages.DecoratorBeforeExport); } else { return true; } @@ -11065,14 +12944,36 @@ class StatementParser extends ExpressionParser { 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]; - this.checkDuplicateExports(specifier, specifier.exported.name); + for (let _i4 = 0, _node$specifiers = node.specifiers; _i4 < _node$specifiers.length; _i4++) { + const specifier = _node$specifiers[_i4]; + const { + exported + } = specifier; + const exportedName = exported.type === "Identifier" ? exported.name : exported.value; + this.checkDuplicateExports(specifier, exportedName); if (!isFrom && specifier.local) { - this.checkReservedWord(specifier.local.name, specifier.local.start, true, false); - this.scope.checkLocalExport(specifier.local); + const { + local + } = specifier; + + if (local.type === "StringLiteral") { + this.raise(specifier.start, ErrorMessages.ExportBindingIsString, local.extra.raw, exportedName); + } else { + this.checkReservedWord(local.name, local.start, true, false); + this.scope.checkLocalExport(local); + } } } } else if (node.declaration) { @@ -11081,8 +12982,8 @@ class StatementParser extends ExpressionParser { 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]; + for (let _i5 = 0, _node$declaration$dec = node.declaration.declarations; _i5 < _node$declaration$dec.length; _i5++) { + const declaration = _node$declaration$dec[_i5]; this.checkDeclaration(declaration.id); } } @@ -11092,13 +12993,7 @@ class StatementParser extends ExpressionParser { const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; if (currentContextDecorators.length) { - const isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression"); - - if (!node.declaration || !isClass) { - throw this.raise(node.start, "You can only use decorators on an export when exporting a class"); - } - - this.takeDecorators(node.declaration); + throw this.raise(node.start, ErrorMessages.UnsupportedDecoratorExport); } } @@ -11106,13 +13001,13 @@ class StatementParser extends ExpressionParser { 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]; + for (let _i6 = 0, _node$properties = node.properties; _i6 < _node$properties.length; _i6++) { + const prop = _node$properties[_i6]; 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]; + for (let _i7 = 0, _node$elements = node.elements; _i7 < _node$elements.length; _i7++) { + const elem = _node$elements[_i7]; if (elem) { this.checkDeclaration(elem); @@ -11129,7 +13024,7 @@ class StatementParser extends ExpressionParser { checkDuplicateExports(node, name) { if (this.state.exportedIdentifiers.indexOf(name) > -1) { - throw this.raise(node.start, name === "default" ? "Only one default export allowed per module." : `\`${name}\` has already been exported. Exported identifiers must be unique.`); + this.raise(node.start, name === "default" ? ErrorMessages.DuplicateDefaultExport : ErrorMessages.DuplicateExport, name); } this.state.exportedIdentifiers.push(name); @@ -11149,14 +13044,30 @@ class StatementParser extends ExpressionParser { } const node = this.startNode(); - node.local = this.parseIdentifier(true); - node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone(); + 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 = []; @@ -11169,6 +13080,18 @@ class StatementParser extends ExpressionParser { } 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"); } @@ -11184,10 +13107,106 @@ class StatementParser extends ExpressionParser { parseImportSpecifierLocal(node, specifier, type, contextDescription) { specifier.local = this.parseIdentifier(); - this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription); + 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"); @@ -11218,7 +13237,7 @@ class StatementParser extends ExpressionParser { first = false; } else { if (this.eat(types.colon)) { - this.unexpected(null, "ES2015 named imports do not destructure. " + "Use another statement for destructuring after the import."); + throw this.raise(this.state.start, ErrorMessages.DestructureNamedImport); } this.expect(types.comma); @@ -11231,21 +13250,113 @@ class StatementParser extends ExpressionParser { parseImportSpecifier(node) { const specifier = this.startNode(); - specifier.imported = this.parseIdentifier(true); + specifier.imported = this.parseModuleExportName(); if (this.eatContextual("as")) { specifier.local = this.parseIdentifier(); } else { - this.checkReservedWord(specifier.imported.name, specifier.start, true, true); - specifier.local = specifier.imported.__clone(); + 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, BIND_LEXICAL, undefined, "import specifier"); + this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL); node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); } } +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); + } + } + +} + class Parser extends StatementParser { constructor(options, input) { options = getOptions(options); @@ -11254,6 +13365,9 @@ class Parser extends StatementParser { this.options = options; this.inModule = this.options.sourceType === "module"; this.scope = new ScopeHandler(this.raise.bind(this), this.inModule); + this.prodParam = new ProductionParameterHandler(); + this.classScope = new ClassScopeHandler(this.raise.bind(this)); + this.expressionScope = new ExpressionScopeHandler(this.raise.bind(this)); this.plugins = pluginsMap(this.options.plugins); this.filename = options.sourceFilename; } @@ -11263,11 +13377,21 @@ class Parser extends StatementParser { } parse() { + let paramFlags = PARAM; + + if (this.hasPlugin("topLevelAwait") && this.inModule) { + paramFlags |= PARAM_AWAIT; + } + this.scope.enter(SCOPE_PROGRAM); + this.prodParam.enter(paramFlags); const file = this.startNode(); const program = this.startNode(); this.nextToken(); - return this.parseTopLevel(file, program); + file.errors = null; + this.parseTopLevel(file, program); + file.errors = this.state.errors; + return file; } } @@ -11285,20 +13409,35 @@ function pluginsMap(plugins) { } function parse(input, options) { - if (options && options.sourceType === "unambiguous") { + 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) ast.program.sourceType = "script"; + + 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 (scriptError) {} + } catch (_unused2) {} throw moduleError; } @@ -11319,7 +13458,7 @@ function parseExpression(input, options) { function getParser(options, input) { let cls = Parser; - if (options && options.plugins) { + if (options == null ? void 0 : options.plugins) { validatePlugins(options.plugins); cls = getParserClass(options.plugins); } @@ -11351,3 +13490,4 @@ function getParserClass(pluginsFromOptions) { exports.parse = parse; exports.parseExpression = parseExpression; exports.tokTypes = types; +//# sourceMappingURL=index.js.map diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/parser/package.json b/tools/node_modules/@babel/core/node_modules/@babel/parser/package.json similarity index 50% rename from tools/node_modules/babel-eslint/node_modules/@babel/parser/package.json rename to tools/node_modules/@babel/core/node_modules/@babel/parser/package.json index 4bfd8d41cb84c0..d26cd44fb7852b 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/parser/package.json +++ b/tools/node_modules/@babel/core/node_modules/@babel/parser/package.json @@ -1,30 +1,13 @@ { - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bin": { - "parser": "./bin/babel-parser.js" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "@babel/parser", + "version": "7.12.7", "description": "A JavaScript parser", - "devDependencies": { - "@babel/code-frame": "^7.5.5", - "@babel/helper-fixtures": "^7.5.5", - "charcodes": "^0.2.0", - "unicode-12.0.0": "^0.7.9" - }, - "engines": { - "node": ">=6.0.0" - }, - "files": [ - "bin", - "lib", - "typings" - ], - "gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43", + "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, "keywords": [ "babel", "javascript", @@ -33,16 +16,26 @@ "ecmascript", "@babel/parser" ], - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/parser", - "publishConfig": { - "tag": "next" - }, "repository": { "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/babel-parser" + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-parser" }, + "main": "lib/index.js", "types": "typings/babel-parser.d.ts", - "version": "7.5.5" + "files": [ + "bin", + "lib", + "typings" + ], + "engines": { + "node": ">=6.0.0" + }, + "devDependencies": { + "@babel/code-frame": "7.10.4", + "@babel/helper-fixtures": "7.10.5", + "@babel/helper-validator-identifier": "7.10.4", + "charcodes": "^0.2.0" + }, + "bin": "./bin/babel-parser.js" } \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/template/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/template/LICENSE new file mode 100644 index 00000000000000..f31575ec773bb1 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/template/LICENSE @@ -0,0 +1,22 @@ +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/tools/node_modules/@babel/core/node_modules/@babel/template/README.md b/tools/node_modules/@babel/core/node_modules/@babel/template/README.md new file mode 100644 index 00000000000000..759c65aa6b1bce --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/template/README.md @@ -0,0 +1,19 @@ +# @babel/template + +> Generate an AST from a string template. + +See our website [@babel/template](https://babeljs.io/docs/en/babel-template) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20template%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/template +``` + +or using yarn: + +```sh +yarn add @babel/template --dev +``` diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/builder.js b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/builder.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/template/lib/builder.js rename to tools/node_modules/@babel/core/node_modules/@babel/template/lib/builder.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/formatters.js b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/formatters.js similarity index 51% rename from tools/node_modules/babel-eslint/node_modules/@babel/template/lib/formatters.js rename to tools/node_modules/@babel/core/node_modules/@babel/template/lib/formatters.js index 59e0984cba5a0d..b045cc76e59ba8 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/formatters.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/formatters.js @@ -5,6 +5,12 @@ Object.defineProperty(exports, "__esModule", { }); exports.program = exports.expression = exports.statement = exports.statements = exports.smart = void 0; +var t = _interopRequireWildcard(require("@babel/types")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + function makeStatementFormatter(fn) { return { code: str => `/* @babel/template */;\n${str}`, @@ -39,20 +45,22 @@ const statement = makeStatementFormatter(body => { exports.statement = statement; const expression = { code: str => `(\n${str}\n)`, - validate: ({ - program - }) => { - if (program.body.length > 1) { + validate: ast => { + if (ast.program.body.length > 1) { throw new Error("Found multiple statements but wanted one"); } - const expression = program.body[0].expression; - - if (expression.start === 0) { + if (expression.unwrap(ast).start === 0) { throw new Error("Parse result included parens."); } }, - unwrap: ast => ast.program.body[0].expression + unwrap: ({ + program + }) => { + const [stmt] = program.body; + t.assertExpressionStatement(stmt); + return stmt.expression; + } }; exports.expression = expression; const program = { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/index.js similarity index 56% rename from tools/node_modules/babel-eslint/node_modules/@babel/template/lib/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/template/lib/index.js index 7ce85e9f1ba624..9c666dbcc1cf5b 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/index.js @@ -11,7 +11,9 @@ var _builder = _interopRequireDefault(require("./builder")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } const smart = (0, _builder.default)(formatters.smart); exports.smart = smart; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/literal.js b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/literal.js similarity index 93% rename from tools/node_modules/babel-eslint/node_modules/@babel/template/lib/literal.js rename to tools/node_modules/@babel/core/node_modules/@babel/template/lib/literal.js index 0b8f9045826585..b68fd68dbd6da7 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/literal.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/literal.js @@ -19,10 +19,10 @@ function literalTemplate(formatter, tpl, opts) { names } = buildLiteralData(formatter, tpl, opts); return arg => { - const defaultReplacements = arg.reduce((acc, replacement, i) => { - acc[names[i]] = replacement; - return acc; - }, {}); + const defaultReplacements = {}; + arg.forEach((replacement, i) => { + defaultReplacements[names[i]] = replacement; + }); return arg => { const replacements = (0, _options.normalizeReplacements)(arg); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/options.js b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/options.js similarity index 97% rename from tools/node_modules/babel-eslint/node_modules/@babel/template/lib/options.js rename to tools/node_modules/@babel/core/node_modules/@babel/template/lib/options.js index 35ed7333885925..8622c640b72d37 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/options.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/options.js @@ -63,7 +63,7 @@ function validate(opts) { parser, placeholderWhitelist: placeholderWhitelist || undefined, placeholderPattern: placeholderPattern == null ? undefined : placeholderPattern, - preserveComments: preserveComments == null ? false : preserveComments, + preserveComments: preserveComments == null ? undefined : preserveComments, syntacticPlaceholders: syntacticPlaceholders == null ? undefined : syntacticPlaceholders }; } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/parse.js b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/parse.js similarity index 58% rename from tools/node_modules/babel-eslint/node_modules/@babel/template/lib/parse.js rename to tools/node_modules/@babel/core/node_modules/@babel/template/lib/parse.js index 3173349559283e..ff5497b7d7d55b 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/parse.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/parse.js @@ -5,49 +5,27 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = parseAndBuildMetadata; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; - - return data; -} - -function _parser() { - const data = require("@babel/parser"); +var _parser = require("@babel/parser"); - _parser = function () { - return data; - }; - - return data; -} +var _codeFrame = require("@babel/code-frame"); -function _codeFrame() { - const data = require("@babel/code-frame"); +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - _codeFrame = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } const PATTERN = /^[_$A-Z0-9]+$/; function parseAndBuildMetadata(formatter, code, opts) { - const ast = parseWithCodeFrame(code, opts.parser); const { placeholderWhitelist, placeholderPattern, preserveComments, syntacticPlaceholders } = opts; - t().removePropertiesDeep(ast, { + const ast = parseWithCodeFrame(code, opts.parser, syntacticPlaceholders); + t.removePropertiesDeep(ast, { preserveComments }); formatter.validate(ast); @@ -62,7 +40,7 @@ function parseAndBuildMetadata(formatter, code, opts) { const isLegacyRef = { value: undefined }; - t().traverse(ast, placeholderVisitorHandler, { + t.traverse(ast, placeholderVisitorHandler, { syntactic, legacy, isLegacyRef, @@ -76,9 +54,11 @@ function parseAndBuildMetadata(formatter, code, opts) { } function placeholderVisitorHandler(node, ancestors, state) { + var _state$placeholderWhi; + let name; - if (t().isPlaceholder(node)) { + if (t.isPlaceholder(node)) { if (state.syntacticPlaceholders === false) { throw new Error("%%foo%%-style placeholders can't be used when " + "'.syntacticPlaceholders' is false."); } else { @@ -87,10 +67,10 @@ function placeholderVisitorHandler(node, ancestors, state) { } } else if (state.isLegacyRef.value === false || state.syntacticPlaceholders) { return; - } else if (t().isIdentifier(node) || t().isJSXIdentifier(node)) { + } else if (t.isIdentifier(node) || t.isJSXIdentifier(node)) { name = node.name; state.isLegacyRef.value = true; - } else if (t().isStringLiteral(node)) { + } else if (t.isStringLiteral(node)) { name = node.value; state.isLegacyRef.value = true; } else { @@ -101,7 +81,7 @@ function placeholderVisitorHandler(node, ancestors, state) { throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'"); } - if (state.isLegacyRef.value && (state.placeholderPattern === false || !(state.placeholderPattern || PATTERN).test(name)) && (!state.placeholderWhitelist || !state.placeholderWhitelist.has(name))) { + if (state.isLegacyRef.value && (state.placeholderPattern === false || !(state.placeholderPattern || PATTERN).test(name)) && !((_state$placeholderWhi = state.placeholderWhitelist) == null ? void 0 : _state$placeholderWhi.has(name))) { return; } @@ -112,16 +92,16 @@ function placeholderVisitorHandler(node, ancestors, state) { } = ancestors[ancestors.length - 1]; let type; - if (t().isStringLiteral(node) || t().isPlaceholder(node, { + if (t.isStringLiteral(node) || t.isPlaceholder(node, { expectedNode: "StringLiteral" })) { type = "string"; - } else if (t().isNewExpression(parent) && key === "arguments" || t().isCallExpression(parent) && key === "arguments" || t().isFunction(parent) && key === "params") { + } else if (t.isNewExpression(parent) && key === "arguments" || t.isCallExpression(parent) && key === "arguments" || t.isFunction(parent) && key === "params") { type = "param"; - } else if (t().isExpressionStatement(parent) && !t().isPlaceholder(node)) { + } else if (t.isExpressionStatement(parent) && !t.isPlaceholder(node)) { type = "statement"; ancestors = ancestors.slice(0, -1); - } else if (t().isStatement(node) && t().isPlaceholder(node)) { + } else if (t.isStatement(node) && t.isPlaceholder(node)) { type = "statement"; } else { type = "other"; @@ -167,22 +147,28 @@ function resolveAncestors(ast, ancestors) { }; } -function parseWithCodeFrame(code, parserOpts) { +function parseWithCodeFrame(code, parserOpts, syntacticPlaceholders) { + const plugins = (parserOpts.plugins || []).slice(); + + if (syntacticPlaceholders !== false) { + plugins.push("placeholders"); + } + parserOpts = Object.assign({ allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, sourceType: "module" }, parserOpts, { - plugins: (parserOpts.plugins || []).concat("placeholders") + plugins }); try { - return (0, _parser().parse)(code, parserOpts); + return (0, _parser.parse)(code, parserOpts); } catch (err) { const loc = err.loc; if (loc) { - err.message += "\n" + (0, _codeFrame().codeFrameColumns)(code, { + err.message += "\n" + (0, _codeFrame.codeFrameColumns)(code, { start: loc }); err.code = "BABEL_TEMPLATE_PARSE_ERROR"; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/populate.js b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/populate.js similarity index 62% rename from tools/node_modules/babel-eslint/node_modules/@babel/template/lib/populate.js rename to tools/node_modules/@babel/core/node_modules/@babel/template/lib/populate.js index c69f7fdfe282f9..cbca1917c962dc 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/populate.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/populate.js @@ -5,20 +5,14 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = populatePlaceholders; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function populatePlaceholders(metadata, replacements) { - const ast = t().cloneNode(metadata.ast); + const ast = t.cloneNode(metadata.ast); if (replacements) { metadata.placeholders.forEach(placeholder => { @@ -51,9 +45,9 @@ function populatePlaceholders(metadata, replacements) { function applyReplacement(placeholder, ast, replacement) { if (placeholder.isDuplicate) { if (Array.isArray(replacement)) { - replacement = replacement.map(node => t().cloneNode(node)); + replacement = replacement.map(node => t.cloneNode(node)); } else if (typeof replacement === "object") { - replacement = t().cloneNode(replacement); + replacement = t.cloneNode(replacement); } } @@ -65,43 +59,43 @@ function applyReplacement(placeholder, ast, replacement) { if (placeholder.type === "string") { if (typeof replacement === "string") { - replacement = t().stringLiteral(replacement); + replacement = t.stringLiteral(replacement); } - if (!replacement || !t().isStringLiteral(replacement)) { + if (!replacement || !t.isStringLiteral(replacement)) { throw new Error("Expected string substitution"); } } else if (placeholder.type === "statement") { if (index === undefined) { if (!replacement) { - replacement = t().emptyStatement(); + replacement = t.emptyStatement(); } else if (Array.isArray(replacement)) { - replacement = t().blockStatement(replacement); + replacement = t.blockStatement(replacement); } else if (typeof replacement === "string") { - replacement = t().expressionStatement(t().identifier(replacement)); - } else if (!t().isStatement(replacement)) { - replacement = t().expressionStatement(replacement); + replacement = t.expressionStatement(t.identifier(replacement)); + } else if (!t.isStatement(replacement)) { + replacement = t.expressionStatement(replacement); } } else { if (replacement && !Array.isArray(replacement)) { if (typeof replacement === "string") { - replacement = t().identifier(replacement); + replacement = t.identifier(replacement); } - if (!t().isStatement(replacement)) { - replacement = t().expressionStatement(replacement); + if (!t.isStatement(replacement)) { + replacement = t.expressionStatement(replacement); } } } } else if (placeholder.type === "param") { if (typeof replacement === "string") { - replacement = t().identifier(replacement); + replacement = t.identifier(replacement); } if (index === undefined) throw new Error("Assertion failure."); } else { if (typeof replacement === "string") { - replacement = t().identifier(replacement); + replacement = t.identifier(replacement); } if (Array.isArray(replacement)) { @@ -110,7 +104,7 @@ function applyReplacement(placeholder, ast, replacement) { } if (index === undefined) { - t().validate(parent, key, replacement); + t.validate(parent, key, replacement); parent[key] = replacement; } else { const items = parent[key].slice(); @@ -127,7 +121,7 @@ function applyReplacement(placeholder, ast, replacement) { items[index] = replacement; } - t().validate(parent, key, items); + t.validate(parent, key, items); parent[key] = items; } } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/template/lib/string.js b/tools/node_modules/@babel/core/node_modules/@babel/template/lib/string.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/template/lib/string.js rename to tools/node_modules/@babel/core/node_modules/@babel/template/lib/string.js diff --git a/tools/node_modules/@babel/core/node_modules/@babel/template/package.json b/tools/node_modules/@babel/core/node_modules/@babel/template/package.json new file mode 100644 index 00000000000000..59729290baacc0 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/template/package.json @@ -0,0 +1,22 @@ +{ + "name": "@babel/template", + "version": "7.12.7", + "description": "Generate an AST from a string template.", + "author": "Sebastian McKenzie ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-template" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7" + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/traverse/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/traverse/LICENSE new file mode 100644 index 00000000000000..f31575ec773bb1 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/LICENSE @@ -0,0 +1,22 @@ +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/tools/node_modules/babel-eslint/node_modules/@babel/traverse/README.md b/tools/node_modules/@babel/core/node_modules/@babel/traverse/README.md similarity index 51% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/README.md rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/README.md index 61dc5800652eec..e478f16fb1c630 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/README.md +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/README.md @@ -2,7 +2,7 @@ > The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes -See our website [@babel/traverse](https://babeljs.io/docs/en/next/babel-traverse.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20traverse%22+is%3Aopen) associated with this package. +See our website [@babel/traverse](https://babeljs.io/docs/en/babel-traverse) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20traverse%22+is%3Aopen) associated with this package. ## Install diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/cache.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/cache.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/cache.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/cache.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/context.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js similarity index 70% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/context.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js index 7becbcd2573090..be050480a29db9 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/context.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js @@ -7,17 +7,11 @@ exports.default = void 0; var _path = _interopRequireDefault(require("./path")); -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -36,8 +30,8 @@ class TraversalContext { const opts = this.opts; if (opts.enter || opts.exit) return true; if (opts[node.type]) return true; - const keys = t().VISITOR_KEYS[node.type]; - if (!keys || !keys.length) return false; + const keys = t.VISITOR_KEYS[node.type]; + if (!(keys == null ? void 0 : keys.length)) return false; for (const key of keys) { if (node[key]) return true; @@ -96,7 +90,7 @@ class TraversalContext { visitQueue(queue) { this.queue = queue; this.priorityQueue = []; - const visited = []; + const visited = new WeakSet(); let stop = false; for (const path of queue) { @@ -112,8 +106,11 @@ class TraversalContext { this.trap = true; } - if (visited.indexOf(path.node) >= 0) continue; - visited.push(path.node); + const { + node + } = path; + if (visited.has(node)) continue; + if (node) visited.add(node); if (path.visit()) { stop = true; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/hub.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/hub.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/hub.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/hub.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/index.js similarity index 63% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/index.js index 1865e2abc877c2..057814f43ad8ef 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/index.js @@ -30,25 +30,7 @@ var visitors = _interopRequireWildcard(require("./visitors")); exports.visitors = visitors; -function _includes() { - const data = _interopRequireDefault(require("lodash/includes")); - - _includes = function () { - return data; - }; - - return data; -} - -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} +var t = _interopRequireWildcard(require("@babel/types")); var cache = _interopRequireWildcard(require("./cache")); @@ -58,7 +40,9 @@ var _scope = _interopRequireDefault(require("./scope")); var _hub = _interopRequireDefault(require("./hub")); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -72,6 +56,10 @@ function traverse(parent, opts, scope, state, parentPath) { } } + if (!t.VISITOR_KEYS[parent.type]) { + return; + } + visitors.explode(opts); traverse.node(parent, opts, scope, state, parentPath); } @@ -81,11 +69,11 @@ traverse.verify = visitors.verify; traverse.explode = visitors.explode; traverse.cheap = function (node, enter) { - return t().traverseFast(node, enter); + return t.traverseFast(node, enter); }; traverse.node = function (node, opts, scope, state, parentPath, skipKeys) { - const keys = t().VISITOR_KEYS[node.type]; + const keys = t.VISITOR_KEYS[node.type]; if (!keys) return; const context = new _context.default(scope, opts, state, parentPath); @@ -96,24 +84,24 @@ traverse.node = function (node, opts, scope, state, parentPath, skipKeys) { }; traverse.clearNode = function (node, opts) { - t().removeProperties(node, opts); + t.removeProperties(node, opts); cache.path.delete(node); }; traverse.removeProperties = function (tree, opts) { - t().traverseFast(tree, traverse.clearNode, opts); + t.traverseFast(tree, traverse.clearNode, opts); return tree; }; -function hasBlacklistedType(path, state) { +function hasDenylistedType(path, state) { if (path.node.type === state.type) { state.has = true; path.stop(); } } -traverse.hasType = function (tree, type, blacklistTypes) { - if ((0, _includes().default)(blacklistTypes, tree.type)) return false; +traverse.hasType = function (tree, type, denylistTypes) { + if (denylistTypes == null ? void 0 : denylistTypes.includes(tree.type)) return false; if (tree.type === type) return true; const state = { has: false, @@ -121,8 +109,8 @@ traverse.hasType = function (tree, type, blacklistTypes) { }; traverse(tree, { noScope: true, - blacklist: blacklistTypes, - enter: hasBlacklistedType + denylist: denylistTypes, + enter: hasDenylistedType }, null, state); return state.has; }; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/ancestry.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/ancestry.js similarity index 79% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/ancestry.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/ancestry.js index 60e6a98f0becd3..d2c7908d0d454b 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/ancestry.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/ancestry.js @@ -14,21 +14,15 @@ exports.isAncestor = isAncestor; exports.isDescendant = isDescendant; exports.inType = inType; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} +var t = _interopRequireWildcard(require("@babel/types")); var _index = _interopRequireDefault(require("./index")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function findParent(callback) { let path = this; @@ -75,7 +69,7 @@ function getStatementParent() { function getEarliestCommonAncestorFrom(paths) { return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) { let earliest; - const keys = t().VISITOR_KEYS[deepest.type]; + const keys = t.VISITOR_KEYS[deepest.type]; for (const ancestry of ancestries) { const path = ancestry[i + 1]; diff --git a/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/comments.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/comments.js new file mode 100644 index 00000000000000..1e7f770243d8f4 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/comments.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.shareCommentsWithSiblings = shareCommentsWithSiblings; +exports.addComment = addComment; +exports.addComments = addComments; + +var t = _interopRequireWildcard(require("@babel/types")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function shareCommentsWithSiblings() { + if (typeof this.key === "string") return; + const node = this.node; + if (!node) return; + const trailing = node.trailingComments; + const leading = node.leadingComments; + if (!trailing && !leading) return; + const prev = this.getSibling(this.key - 1); + const next = this.getSibling(this.key + 1); + const hasPrev = Boolean(prev.node); + const hasNext = Boolean(next.node); + + if (hasPrev && !hasNext) { + prev.addComments("trailing", trailing); + } else if (hasNext && !hasPrev) { + next.addComments("leading", leading); + } +} + +function addComment(type, content, line) { + t.addComment(this.node, type, content, line); +} + +function addComments(type, comments) { + t.addComments(this.node, type, comments); +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/context.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js similarity index 86% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/context.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js index eacfc4e9b210d4..47ae8e8f6e11be 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/context.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.call = call; exports._call = _call; -exports.isBlacklisted = isBlacklisted; +exports.isBlacklisted = exports.isDenylisted = isDenylisted; exports.visit = visit; exports.skip = skip; exports.skipKey = skipKey; @@ -26,6 +26,8 @@ exports._getQueueContexts = _getQueueContexts; var _index = _interopRequireDefault(require("../index")); +var _index2 = require("./index"); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function call(key) { @@ -61,15 +63,17 @@ function _call(fns) { } if (this.node !== node) return true; - if (this.shouldStop || this.shouldSkip || this.removed) return true; + if (this._traverseFlags > 0) return true; } return false; } -function isBlacklisted() { - const blacklist = this.opts.blacklist; - return blacklist && blacklist.indexOf(this.node.type) > -1; +function isDenylisted() { + var _this$opts$denylist; + + const denylist = (_this$opts$denylist = this.opts.denylist) != null ? _this$opts$denylist : this.opts.blacklist; + return denylist && denylist.indexOf(this.node.type) > -1; } function visit() { @@ -77,7 +81,7 @@ function visit() { return false; } - if (this.isBlacklisted()) { + if (this.isDenylisted()) { return false; } @@ -85,7 +89,7 @@ function visit() { return false; } - if (this.call("enter") || this.shouldSkip) { + if (this.shouldSkip || this.call("enter") || this.shouldSkip) { this.debug("Skip..."); return this.shouldStop; } @@ -103,12 +107,15 @@ function skip() { } function skipKey(key) { + if (this.skipKeys == null) { + this.skipKeys = {}; + } + this.skipKeys[key] = true; } function stop() { - this.shouldStop = true; - this.shouldSkip = true; + this._traverseFlags |= _index2.SHOULD_SKIP | _index2.SHOULD_STOP; } function setScope() { @@ -127,10 +134,11 @@ function setScope() { } function setContext(context) { - this.shouldSkip = false; - this.shouldStop = false; - this.removed = false; - this.skipKeys = {}; + if (this.skipKeys != null) { + this.skipKeys = {}; + } + + this._traverseFlags = 0; if (context) { this.context = context; @@ -208,18 +216,18 @@ function pushContext(context) { } function setup(parentPath, container, listKey, key) { - this.inList = !!listKey; this.listKey = listKey; - this.parentKey = listKey || key; this.container = container; this.parentPath = parentPath || this.parentPath; this.setKey(key); } function setKey(key) { + var _this$node; + this.key = key; this.node = this.container[this.key]; - this.type = this.node && this.node.type; + this.type = (_this$node = this.node) == null ? void 0 : _this$node.type; } function requeue(pathToQueue = this) { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/conversion.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/conversion.js similarity index 62% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/conversion.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/conversion.js index 9faa9053bc94e2..f6a1198791c3dc 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/conversion.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/conversion.js @@ -9,29 +9,15 @@ exports.arrowFunctionToShadowed = arrowFunctionToShadowed; exports.unwrapFunctionEnvironment = unwrapFunctionEnvironment; exports.arrowFunctionToExpression = arrowFunctionToExpression; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; - - return data; -} - -function _helperFunctionName() { - const data = _interopRequireDefault(require("@babel/helper-function-name")); - - _helperFunctionName = function () { - return data; - }; - - return data; -} +var _helperFunctionName = _interopRequireDefault(require("@babel/helper-function-name")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function toComputedKey() { const node = this.node; @@ -46,7 +32,7 @@ function toComputedKey() { } if (!node.computed) { - if (t().isIdentifier(key)) key = t().stringLiteral(key.name); + if (t.isIdentifier(key)) key = t.stringLiteral(key.name); } return key; @@ -82,14 +68,14 @@ function ensureBlock() { if (this.isFunction()) { key = "argument"; - statements.push(t().returnStatement(body.node)); + statements.push(t.returnStatement(body.node)); } else { key = "expression"; - statements.push(t().expressionStatement(body.node)); + statements.push(t.expressionStatement(body.node)); } } - this.node.body = t().blockStatement(statements); + this.node.body = t.blockStatement(statements); const parentPath = this.get(stringPath); body.setup(parentPath, listKey ? parentPath.node[listKey] : parentPath.node, listKey, key); return this.node; @@ -126,12 +112,12 @@ function arrowFunctionToExpression({ if (checkBinding) { this.parentPath.scope.push({ id: checkBinding, - init: t().objectExpression([]) + init: t.objectExpression([]) }); } - this.get("body").unshiftContainer("body", t().expressionStatement(t().callExpression(this.hub.addHelper("newArrowCheck"), [t().thisExpression(), checkBinding ? t().identifier(checkBinding.name) : t().identifier(thisBinding)]))); - this.replaceWith(t().callExpression(t().memberExpression((0, _helperFunctionName().default)(this, true) || this.node, t().identifier("bind")), [checkBinding ? t().identifier(checkBinding.name) : t().thisExpression()])); + this.get("body").unshiftContainer("body", t.expressionStatement(t.callExpression(this.hub.addHelper("newArrowCheck"), [t.thisExpression(), checkBinding ? t.identifier(checkBinding.name) : t.identifier(thisBinding)]))); + this.replaceWith(t.callExpression(t.memberExpression((0, _helperFunctionName.default)(this, true) || this.node, t.identifier("bind")), [checkBinding ? t.identifier(checkBinding.name) : t.thisExpression()])); } } @@ -141,7 +127,7 @@ function hoistFunctionEnvironment(fnPath, specCompliant = false, allowInsertArro static: false }); }); - const inConstructor = thisEnvFn && thisEnvFn.node.kind === "constructor"; + const inConstructor = (thisEnvFn == null ? void 0 : thisEnvFn.node.kind) === "constructor"; if (thisEnvFn.isClassProperty()) { throw fnPath.buildCodeFrameError("Unable to transform arrow inside class property"); @@ -179,40 +165,25 @@ function hoistFunctionEnvironment(fnPath, specCompliant = false, allowInsertArro }); const superBinding = getSuperBinding(thisEnvFn); allSuperCalls.forEach(superCall => { - const callee = t().identifier(superBinding); + const callee = t.identifier(superBinding); callee.loc = superCall.node.callee.loc; superCall.get("callee").replaceWith(callee); }); } - let thisBinding; - - if (thisPaths.length > 0 || specCompliant) { - thisBinding = getThisBinding(thisEnvFn, inConstructor); - - if (!specCompliant || inConstructor && hasSuperClass(thisEnvFn)) { - thisPaths.forEach(thisChild => { - const thisRef = thisChild.isJSX() ? t().jsxIdentifier(thisBinding) : t().identifier(thisBinding); - thisRef.loc = thisChild.node.loc; - thisChild.replaceWith(thisRef); - }); - if (specCompliant) thisBinding = null; - } - } - if (argumentsPaths.length > 0) { - const argumentsBinding = getBinding(thisEnvFn, "arguments", () => t().identifier("arguments")); + const argumentsBinding = getBinding(thisEnvFn, "arguments", () => t.identifier("arguments")); argumentsPaths.forEach(argumentsChild => { - const argsRef = t().identifier(argumentsBinding); + const argsRef = t.identifier(argumentsBinding); argsRef.loc = argumentsChild.node.loc; argumentsChild.replaceWith(argsRef); }); } if (newTargetPaths.length > 0) { - const newTargetBinding = getBinding(thisEnvFn, "newtarget", () => t().metaProperty(t().identifier("new"), t().identifier("target"))); + const newTargetBinding = getBinding(thisEnvFn, "newtarget", () => t.metaProperty(t.identifier("new"), t.identifier("target"))); newTargetPaths.forEach(targetChild => { - const targetRef = t().identifier(newTargetBinding); + const targetRef = t.identifier(newTargetBinding); targetRef.loc = targetChild.node.loc; targetChild.replaceWith(targetRef); }); @@ -226,41 +197,53 @@ function hoistFunctionEnvironment(fnPath, specCompliant = false, allowInsertArro const flatSuperProps = superProps.reduce((acc, superProp) => acc.concat(standardizeSuperProperty(superProp)), []); flatSuperProps.forEach(superProp => { const key = superProp.node.computed ? "" : superProp.get("property").node.name; - - if (superProp.parentPath.isCallExpression({ + const isAssignment = superProp.parentPath.isAssignmentExpression({ + left: superProp.node + }); + const isCall = superProp.parentPath.isCallExpression({ callee: superProp.node - })) { - const superBinding = getSuperPropCallBinding(thisEnvFn, key); - - if (superProp.node.computed) { - const prop = superProp.get("property").node; - superProp.replaceWith(t().identifier(superBinding)); - superProp.parentPath.node.arguments.unshift(prop); - } else { - superProp.replaceWith(t().identifier(superBinding)); - } + }); + const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key); + const args = []; + + if (superProp.node.computed) { + args.push(superProp.get("property").node); + } + + if (isAssignment) { + const value = superProp.parentPath.node.right; + args.push(value); + } + + const call = t.callExpression(t.identifier(superBinding), args); + + if (isCall) { + superProp.parentPath.unshiftContainer("arguments", t.thisExpression()); + superProp.replaceWith(t.memberExpression(call, t.identifier("call"))); + thisPaths.push(superProp.parentPath.get("arguments.0")); + } else if (isAssignment) { + superProp.parentPath.replaceWith(call); } else { - const isAssignment = superProp.parentPath.isAssignmentExpression({ - left: superProp.node - }); - const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key); - const args = []; - - if (superProp.node.computed) { - args.push(superProp.get("property").node); - } - - if (isAssignment) { - const value = superProp.parentPath.node.right; - args.push(value); - superProp.parentPath.replaceWith(t().callExpression(t().identifier(superBinding), args)); - } else { - superProp.replaceWith(t().callExpression(t().identifier(superBinding), args)); - } + superProp.replaceWith(call); } }); } + let thisBinding; + + if (thisPaths.length > 0 || specCompliant) { + thisBinding = getThisBinding(thisEnvFn, inConstructor); + + if (!specCompliant || inConstructor && hasSuperClass(thisEnvFn)) { + thisPaths.forEach(thisChild => { + const thisRef = thisChild.isJSX() ? t.jsxIdentifier(thisBinding) : t.identifier(thisBinding); + thisRef.loc = thisChild.node.loc; + thisChild.replaceWith(thisRef); + }); + if (specCompliant) thisBinding = null; + } + } + return thisBinding; } @@ -273,11 +256,11 @@ function standardizeSuperProperty(superProp) { if (superProp.node.computed) { const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp"); - assignmentPath.get("left").replaceWith(t().memberExpression(superProp.node.object, t().assignmentExpression("=", tmp, superProp.node.property), true)); - assignmentPath.get("right").replaceWith(t().binaryExpression(op, t().memberExpression(superProp.node.object, t().identifier(tmp.name), true), value)); + assignmentPath.get("left").replaceWith(t.memberExpression(superProp.node.object, t.assignmentExpression("=", tmp, superProp.node.property), true)); + assignmentPath.get("right").replaceWith(t.binaryExpression(op, t.memberExpression(superProp.node.object, t.identifier(tmp.name), true), value)); } else { - assignmentPath.get("left").replaceWith(t().memberExpression(superProp.node.object, superProp.node.property)); - assignmentPath.get("right").replaceWith(t().binaryExpression(op, t().memberExpression(superProp.node.object, t().identifier(superProp.node.property.name)), value)); + assignmentPath.get("left").replaceWith(t.memberExpression(superProp.node.object, superProp.node.property)); + assignmentPath.get("right").replaceWith(t.binaryExpression(op, t.memberExpression(superProp.node.object, t.identifier(superProp.node.property.name)), value)); } return [assignmentPath.get("left"), assignmentPath.get("right").get("left")]; @@ -285,13 +268,13 @@ function standardizeSuperProperty(superProp) { const updateExpr = superProp.parentPath; const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp"); const computedKey = superProp.node.computed ? superProp.scope.generateDeclaredUidIdentifier("prop") : null; - const parts = [t().assignmentExpression("=", tmp, t().memberExpression(superProp.node.object, computedKey ? t().assignmentExpression("=", computedKey, superProp.node.property) : superProp.node.property, superProp.node.computed)), t().assignmentExpression("=", t().memberExpression(superProp.node.object, computedKey ? t().identifier(computedKey.name) : superProp.node.property, superProp.node.computed), t().binaryExpression("+", t().identifier(tmp.name), t().numericLiteral(1)))]; + const parts = [t.assignmentExpression("=", tmp, t.memberExpression(superProp.node.object, computedKey ? t.assignmentExpression("=", computedKey, superProp.node.property) : superProp.node.property, superProp.node.computed)), t.assignmentExpression("=", t.memberExpression(superProp.node.object, computedKey ? t.identifier(computedKey.name) : superProp.node.property, superProp.node.computed), t.binaryExpression("+", t.identifier(tmp.name), t.numericLiteral(1)))]; if (!superProp.parentPath.node.prefix) { - parts.push(t().identifier(tmp.name)); + parts.push(t.identifier(tmp.name)); } - updateExpr.replaceWith(t().sequenceExpression(parts)); + updateExpr.replaceWith(t.sequenceExpression(parts)); const left = updateExpr.get("expressions.0.right"); const right = updateExpr.get("expressions.1.left"); return [left, right]; @@ -306,7 +289,7 @@ function hasSuperClass(thisEnvFn) { function getThisBinding(thisEnvFn, inConstructor) { return getBinding(thisEnvFn, "this", thisBinding => { - if (!inConstructor || !hasSuperClass(thisEnvFn)) return t().thisExpression(); + if (!inConstructor || !hasSuperClass(thisEnvFn)) return t.thisExpression(); const supers = new WeakSet(); thisEnvFn.traverse({ Function(child) { @@ -322,7 +305,7 @@ function getThisBinding(thisEnvFn, inConstructor) { if (!child.get("callee").isSuper()) return; if (supers.has(child.node)) return; supers.add(child.node); - child.replaceWithMultiple([child.node, t().assignmentExpression("=", t().identifier(thisBinding), t().identifier("this"))]); + child.replaceWithMultiple([child.node, t.assignmentExpression("=", t.identifier(thisBinding), t.identifier("this"))]); } }); @@ -332,25 +315,7 @@ function getThisBinding(thisEnvFn, inConstructor) { function getSuperBinding(thisEnvFn) { return getBinding(thisEnvFn, "supercall", () => { const argsBinding = thisEnvFn.scope.generateUidIdentifier("args"); - return t().arrowFunctionExpression([t().restElement(argsBinding)], t().callExpression(t().super(), [t().spreadElement(t().identifier(argsBinding.name))])); - }); -} - -function getSuperPropCallBinding(thisEnvFn, propName) { - return getBinding(thisEnvFn, `superprop_call:${propName || ""}`, () => { - const argsBinding = thisEnvFn.scope.generateUidIdentifier("args"); - const argsList = [t().restElement(argsBinding)]; - let fnBody; - - if (propName) { - fnBody = t().callExpression(t().memberExpression(t().super(), t().identifier(propName)), [t().spreadElement(t().identifier(argsBinding.name))]); - } else { - const method = thisEnvFn.scope.generateUidIdentifier("prop"); - argsList.unshift(method); - fnBody = t().callExpression(t().memberExpression(t().super(), t().identifier(method.name), true), [t().spreadElement(t().identifier(argsBinding.name))]); - } - - return t().arrowFunctionExpression(argsList, fnBody); + return t.arrowFunctionExpression([t.restElement(argsBinding)], t.callExpression(t.super(), [t.spreadElement(t.identifier(argsBinding.name))])); }); } @@ -361,20 +326,20 @@ function getSuperPropBinding(thisEnvFn, isAssignment, propName) { let fnBody; if (propName) { - fnBody = t().memberExpression(t().super(), t().identifier(propName)); + fnBody = t.memberExpression(t.super(), t.identifier(propName)); } else { const method = thisEnvFn.scope.generateUidIdentifier("prop"); argsList.unshift(method); - fnBody = t().memberExpression(t().super(), t().identifier(method.name), true); + fnBody = t.memberExpression(t.super(), t.identifier(method.name), true); } if (isAssignment) { const valueIdent = thisEnvFn.scope.generateUidIdentifier("value"); argsList.push(valueIdent); - fnBody = t().assignmentExpression("=", fnBody, t().identifier(valueIdent.name)); + fnBody = t.assignmentExpression("=", fnBody, t.identifier(valueIdent.name)); } - return t().arrowFunctionExpression(argsList, fnBody); + return t.arrowFunctionExpression(argsList, fnBody); }); } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/evaluation.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/evaluation.js similarity index 97% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/evaluation.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/evaluation.js index 61c0a550b138ba..61dfd0b039b3b6 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/evaluation.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/evaluation.js @@ -132,7 +132,7 @@ function _evaluate(path, state) { return deopt(binding.path, state); } - if (binding && binding.hasValue) { + if (binding == null ? void 0 : binding.hasValue) { return binding.value; } else { if (node.name === "undefined") { @@ -197,7 +197,7 @@ function _evaluate(path, state) { if (elemValue.confident) { arr.push(elemValue.value); } else { - return deopt(elem, state); + return deopt(elemValue.deopt, state); } } @@ -220,7 +220,7 @@ function _evaluate(path, state) { key = key.evaluate(); if (!key.confident) { - return deopt(keyPath, state); + return deopt(key.deopt, state); } key = key.value; @@ -234,7 +234,7 @@ function _evaluate(path, state) { let value = valuePath.evaluate(); if (!value.confident) { - return deopt(valuePath, state); + return deopt(value.deopt, state); } value = value.value; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/family.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/family.js similarity index 60% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/family.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/family.js index 42b3fc69597a80..4134df724940db 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/family.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/family.js @@ -20,17 +20,11 @@ exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths; var _index = _interopRequireDefault(require("./index")); -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -47,6 +41,73 @@ function addCompletionRecords(path, paths) { return paths; } +function findBreak(statements) { + let breakStatement; + + if (!Array.isArray(statements)) { + statements = [statements]; + } + + for (const statement of statements) { + if (statement.isDoExpression() || statement.isProgram() || statement.isBlockStatement() || statement.isCatchClause() || statement.isLabeledStatement()) { + breakStatement = findBreak(statement.get("body")); + } else if (statement.isIfStatement()) { + var _findBreak; + + breakStatement = (_findBreak = findBreak(statement.get("consequent"))) != null ? _findBreak : findBreak(statement.get("alternate")); + } else if (statement.isTryStatement()) { + var _findBreak2; + + breakStatement = (_findBreak2 = findBreak(statement.get("block"))) != null ? _findBreak2 : findBreak(statement.get("handler")); + } else if (statement.isBreakStatement()) { + breakStatement = statement; + } + + if (breakStatement) { + return breakStatement; + } + } + + return null; +} + +function completionRecordForSwitch(cases, paths) { + let isLastCaseWithConsequent = true; + + for (let i = cases.length - 1; i >= 0; i--) { + const switchCase = cases[i]; + const consequent = switchCase.get("consequent"); + let breakStatement = findBreak(consequent); + + if (breakStatement) { + while (breakStatement.key === 0 && breakStatement.parentPath.isBlockStatement()) { + breakStatement = breakStatement.parentPath; + } + + const prevSibling = breakStatement.getPrevSibling(); + + if (breakStatement.key > 0 && (prevSibling.isExpressionStatement() || prevSibling.isBlockStatement())) { + paths = addCompletionRecords(prevSibling, paths); + breakStatement.remove(); + } else { + breakStatement.replaceWith(breakStatement.scope.buildUndefinedNode()); + paths = addCompletionRecords(breakStatement, paths); + } + } else if (isLastCaseWithConsequent) { + const statementFinder = statement => !statement.isBlockStatement() || statement.get("body").some(statementFinder); + + const hasConsequent = consequent.some(statementFinder); + + if (hasConsequent) { + paths = addCompletionRecords(consequent[consequent.length - 1], paths); + isLastCaseWithConsequent = false; + } + } + } + + return paths; +} + function getCompletionRecords() { let paths = []; @@ -62,9 +123,10 @@ function getCompletionRecords() { } else if (this.isTryStatement()) { paths = addCompletionRecords(this.get("block"), paths); paths = addCompletionRecords(this.get("handler"), paths); - paths = addCompletionRecords(this.get("finalizer"), paths); } else if (this.isCatchClause()) { paths = addCompletionRecords(this.get("body"), paths); + } else if (this.isSwitchStatement()) { + paths = completionRecordForSwitch(this.get("cases"), paths); } else { paths.push(this); } @@ -79,7 +141,7 @@ function getSibling(key) { container: this.container, listKey: this.listKey, key: key - }); + }).setContext(this.context); } function getPrevSibling() { @@ -116,7 +178,7 @@ function getAllPrevSiblings() { return siblings; } -function get(key, context) { +function get(key, context = true) { if (context === true) context = this.context; const parts = key.split("."); @@ -170,11 +232,11 @@ function _getPattern(parts, context) { } function getBindingIdentifiers(duplicates) { - return t().getBindingIdentifiers(this.node, duplicates); + return t.getBindingIdentifiers(this.node, duplicates); } function getOuterBindingIdentifiers(duplicates) { - return t().getOuterBindingIdentifiers(this.node, duplicates); + return t.getOuterBindingIdentifiers(this.node, duplicates); } function getBindingIdentifierPaths(duplicates = false, outerOnly = false) { @@ -186,7 +248,7 @@ function getBindingIdentifierPaths(duplicates = false, outerOnly = false) { const id = search.shift(); if (!id) continue; if (!id.node) continue; - const keys = t().getBindingIdentifiers.keys[id.node.type]; + const keys = t.getBindingIdentifiers.keys[id.node.type]; if (id.isIdentifier()) { if (duplicates) { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/index.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/index.js similarity index 58% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/index.js index 906087f10d8021..f4aa9ba171429a 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/index.js @@ -3,45 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; +exports.default = exports.SHOULD_SKIP = exports.SHOULD_STOP = exports.REMOVED = void 0; var virtualTypes = _interopRequireWildcard(require("./lib/virtual-types")); -function _debug() { - const data = _interopRequireDefault(require("debug")); - - _debug = function () { - return data; - }; - - return data; -} +var _debug = _interopRequireDefault(require("debug")); var _index = _interopRequireDefault(require("../index")); var _scope = _interopRequireDefault(require("../scope")); -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} +var t = _interopRequireWildcard(require("@babel/types")); var _cache = require("../cache"); -function _generator() { - const data = _interopRequireDefault(require("@babel/generator")); - - _generator = function () { - return data; - }; - - return data; -} +var _generator = _interopRequireDefault(require("@babel/generator")); var NodePath_ancestry = _interopRequireWildcard(require("./ancestry")); @@ -67,33 +43,36 @@ var NodePath_comments = _interopRequireWildcard(require("./comments")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -const debug = (0, _debug().default)("babel"); +const debug = (0, _debug.default)("babel"); +const REMOVED = 1 << 0; +exports.REMOVED = REMOVED; +const SHOULD_STOP = 1 << 1; +exports.SHOULD_STOP = SHOULD_STOP; +const SHOULD_SKIP = 1 << 2; +exports.SHOULD_SKIP = SHOULD_SKIP; class NodePath { constructor(hub, parent) { - this.parent = parent; - this.hub = hub; this.contexts = []; - this.data = Object.create(null); - this.shouldSkip = false; - this.shouldStop = false; - this.removed = false; this.state = null; this.opts = null; + this._traverseFlags = 0; this.skipKeys = null; this.parentPath = null; - this.context = null; this.container = null; this.listKey = null; - this.inList = false; - this.parentKey = null; this.key = null; this.node = null; - this.scope = null; this.type = null; - this.typeAnnotation = null; + this.parent = parent; + this.hub = hub; + this.data = null; + this.context = null; + this.scope = null; } static get({ @@ -113,26 +92,20 @@ class NodePath { } const targetNode = container[key]; - const paths = _cache.path.get(parent) || []; - - if (!_cache.path.has(parent)) { - _cache.path.set(parent, paths); - } - let path; + let paths = _cache.path.get(parent); - for (let i = 0; i < paths.length; i++) { - const pathCheck = paths[i]; + if (!paths) { + paths = new Map(); - if (pathCheck.node === targetNode) { - path = pathCheck; - break; - } + _cache.path.set(parent, paths); } + let path = paths.get(targetNode); + if (!path) { path = new NodePath(hub, parent); - paths.push(path); + if (targetNode) paths.set(targetNode, path); } path.setup(parentPath, container, listKey, key); @@ -144,10 +117,18 @@ class NodePath { } setData(key, val) { + if (this.data == null) { + this.data = Object.create(null); + } + return this.data[key] = val; } getData(key, def) { + if (this.data == null) { + this.data = Object.create(null); + } + let val = this.data[key]; if (val === undefined && def !== undefined) val = this.data[key] = def; return val; @@ -162,7 +143,7 @@ class NodePath { } set(key, node) { - t().validate(this.node, key, node); + t.validate(this.node, key, node); this.node[key] = node; } @@ -185,7 +166,57 @@ class NodePath { } toString() { - return (0, _generator().default)(this.node).code; + return (0, _generator.default)(this.node).code; + } + + get inList() { + return !!this.listKey; + } + + set inList(inList) { + if (!inList) { + this.listKey = null; + } + } + + get parentKey() { + return this.listKey || this.key; + } + + get shouldSkip() { + return !!(this._traverseFlags & SHOULD_SKIP); + } + + set shouldSkip(v) { + if (v) { + this._traverseFlags |= SHOULD_SKIP; + } else { + this._traverseFlags &= ~SHOULD_SKIP; + } + } + + get shouldStop() { + return !!(this._traverseFlags & SHOULD_STOP); + } + + set shouldStop(v) { + if (v) { + this._traverseFlags |= SHOULD_STOP; + } else { + this._traverseFlags &= ~SHOULD_STOP; + } + } + + get removed() { + return !!(this._traverseFlags & REMOVED); + } + + set removed(v) { + if (v) { + this._traverseFlags |= REMOVED; + } else { + this._traverseFlags &= ~REMOVED; + } } } @@ -193,9 +224,9 @@ class NodePath { exports.default = NodePath; Object.assign(NodePath.prototype, NodePath_ancestry, NodePath_inference, NodePath_replacement, NodePath_evaluation, NodePath_conversion, NodePath_introspection, NodePath_context, NodePath_removal, NodePath_modification, NodePath_family, NodePath_comments); -for (const type of t().TYPES) { +for (const type of t.TYPES) { const typeKey = `is${type}`; - const fn = t()[typeKey]; + const fn = t[typeKey]; NodePath.prototype[typeKey] = function (opts) { return fn(this.node, opts); @@ -210,7 +241,7 @@ for (const type of t().TYPES) { for (const type of Object.keys(virtualTypes)) { if (type[0] === "_") continue; - if (t().TYPES.indexOf(type) < 0) t().TYPES.push(type); + if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type); const virtualType = virtualTypes[type]; NodePath.prototype[`is${type}`] = function (opts) { diff --git a/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/inference/index.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/inference/index.js new file mode 100644 index 00000000000000..85efbe3b697bb9 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/inference/index.js @@ -0,0 +1,140 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getTypeAnnotation = getTypeAnnotation; +exports._getTypeAnnotation = _getTypeAnnotation; +exports.isBaseType = isBaseType; +exports.couldBeBaseType = couldBeBaseType; +exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches; +exports.isGenericType = isGenericType; + +var inferers = _interopRequireWildcard(require("./inferers")); + +var t = _interopRequireWildcard(require("@babel/types")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function getTypeAnnotation() { + if (this.typeAnnotation) return this.typeAnnotation; + let type = this._getTypeAnnotation() || t.anyTypeAnnotation(); + if (t.isTypeAnnotation(type)) type = type.typeAnnotation; + return this.typeAnnotation = type; +} + +const typeAnnotationInferringNodes = new WeakSet(); + +function _getTypeAnnotation() { + const node = this.node; + + if (!node) { + if (this.key === "init" && this.parentPath.isVariableDeclarator()) { + const declar = this.parentPath.parentPath; + const declarParent = declar.parentPath; + + if (declar.key === "left" && declarParent.isForInStatement()) { + return t.stringTypeAnnotation(); + } + + if (declar.key === "left" && declarParent.isForOfStatement()) { + return t.anyTypeAnnotation(); + } + + return t.voidTypeAnnotation(); + } else { + return; + } + } + + if (node.typeAnnotation) { + return node.typeAnnotation; + } + + if (typeAnnotationInferringNodes.has(node)) { + return; + } + + typeAnnotationInferringNodes.add(node); + + try { + var _inferer; + + let inferer = inferers[node.type]; + + if (inferer) { + return inferer.call(this, node); + } + + inferer = inferers[this.parentPath.type]; + + if ((_inferer = inferer) == null ? void 0 : _inferer.validParent) { + return this.parentPath.getTypeAnnotation(); + } + } finally { + typeAnnotationInferringNodes.delete(node); + } +} + +function isBaseType(baseName, soft) { + return _isBaseType(baseName, this.getTypeAnnotation(), soft); +} + +function _isBaseType(baseName, type, soft) { + if (baseName === "string") { + return t.isStringTypeAnnotation(type); + } else if (baseName === "number") { + return t.isNumberTypeAnnotation(type); + } else if (baseName === "boolean") { + return t.isBooleanTypeAnnotation(type); + } else if (baseName === "any") { + return t.isAnyTypeAnnotation(type); + } else if (baseName === "mixed") { + return t.isMixedTypeAnnotation(type); + } else if (baseName === "empty") { + return t.isEmptyTypeAnnotation(type); + } else if (baseName === "void") { + return t.isVoidTypeAnnotation(type); + } else { + if (soft) { + return false; + } else { + throw new Error(`Unknown base type ${baseName}`); + } + } +} + +function couldBeBaseType(name) { + const type = this.getTypeAnnotation(); + if (t.isAnyTypeAnnotation(type)) return true; + + if (t.isUnionTypeAnnotation(type)) { + for (const type2 of type.types) { + if (t.isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) { + return true; + } + } + + return false; + } else { + return _isBaseType(name, type, true); + } +} + +function baseTypeStrictlyMatches(right) { + const left = this.getTypeAnnotation(); + right = right.getTypeAnnotation(); + + if (!t.isAnyTypeAnnotation(left) && t.isFlowBaseAnnotation(left)) { + return right.type === left.type; + } +} + +function isGenericType(genericName) { + const type = this.getTypeAnnotation(); + return t.isGenericTypeAnnotation(type) && t.isIdentifier(type.id, { + name: genericName + }); +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js similarity index 68% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js index 35601aba7d9ed0..d890af241f1d86 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js @@ -5,17 +5,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = _default; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _default(node) { if (!this.isReferenced()) return; @@ -30,9 +24,9 @@ function _default(node) { } if (node.name === "undefined") { - return t().voidTypeAnnotation(); + return t.voidTypeAnnotation(); } else if (node.name === "NaN" || node.name === "Infinity") { - return t().numberTypeAnnotation(); + return t.numberTypeAnnotation(); } else if (node.name === "arguments") {} } @@ -56,9 +50,19 @@ function getTypeAnnotationBindingConstantViolations(binding, path, name) { } } - if (types.length) { - return t().createUnionTypeAnnotation(types); + if (!types.length) { + return; } + + if (t.isTSTypeAnnotation(types[0]) && t.createTSUnionType) { + return t.createTSUnionType(types); + } + + if (t.createFlowUnionType) { + return t.createFlowUnionType(types); + } + + return t.createUnionTypeAnnotation(types); } function getConstantViolationsBefore(binding, path, functions) { @@ -69,7 +73,7 @@ function getConstantViolationsBefore(binding, path, functions) { const status = violation._guessExecutionStatusRelativeTo(path); - if (functions && status === "function") functions.push(violation); + if (functions && status === "unknown") functions.push(violation); return status === "before"; }); } @@ -95,8 +99,8 @@ function inferAnnotationFromBinaryExpression(name, path) { return target.getTypeAnnotation(); } - if (t().BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { - return t().numberTypeAnnotation(); + if (t.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { + return t.numberTypeAnnotation(); } return; @@ -126,7 +130,7 @@ function inferAnnotationFromBinaryExpression(name, path) { if (!typePath.isLiteral()) return; const typeValue = typePath.node.value; if (typeof typeValue !== "string") return; - return t().createTypeAnnotationBasedOnTypeof(typeValue); + return t.createTypeAnnotationBasedOnTypeof(typeValue); } function getParentConditionalPath(binding, path, name) { @@ -171,8 +175,22 @@ function getConditionalAnnotation(binding, path, name) { } if (types.length) { + if (t.isTSTypeAnnotation(types[0]) && t.createTSUnionType) { + return { + typeAnnotation: t.createTSUnionType(types), + ifStatement + }; + } + + if (t.createFlowUnionType) { + return { + typeAnnotation: t.createFlowUnionType(types), + ifStatement + }; + } + return { - typeAnnotation: t().createUnionTypeAnnotation(types), + typeAnnotation: t.createUnionTypeAnnotation(types), ifStatement }; } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/inference/inferers.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/inference/inferers.js similarity index 53% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/inference/inferers.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/inference/inferers.js index 5890b93827acbe..a187c92b276103 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/inference/inferers.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/inference/inferers.js @@ -33,29 +33,25 @@ Object.defineProperty(exports, "Identifier", { } }); -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} +var t = _interopRequireWildcard(require("@babel/types")); var _infererReference = _interopRequireDefault(require("./inferer-reference")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function VariableDeclarator() { + var _type; + const id = this.get("id"); if (!id.isIdentifier()) return; const init = this.get("init"); let type = init.getTypeAnnotation(); - if (type && type.type === "AnyTypeAnnotation") { + if (((_type = type) == null ? void 0 : _type.type) === "AnyTypeAnnotation") { if (init.isCallExpression() && init.get("callee").isIdentifier({ name: "Array" }) && !init.scope.hasBinding("Array", true)) { @@ -74,55 +70,75 @@ TypeCastExpression.validParent = true; function NewExpression(node) { if (this.get("callee").isIdentifier()) { - return t().genericTypeAnnotation(node.callee); + return t.genericTypeAnnotation(node.callee); } } function TemplateLiteral() { - return t().stringTypeAnnotation(); + return t.stringTypeAnnotation(); } function UnaryExpression(node) { const operator = node.operator; if (operator === "void") { - return t().voidTypeAnnotation(); - } else if (t().NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) { - return t().numberTypeAnnotation(); - } else if (t().STRING_UNARY_OPERATORS.indexOf(operator) >= 0) { - return t().stringTypeAnnotation(); - } else if (t().BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) { - return t().booleanTypeAnnotation(); + return t.voidTypeAnnotation(); + } else if (t.NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) { + return t.numberTypeAnnotation(); + } else if (t.STRING_UNARY_OPERATORS.indexOf(operator) >= 0) { + return t.stringTypeAnnotation(); + } else if (t.BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) { + return t.booleanTypeAnnotation(); } } function BinaryExpression(node) { const operator = node.operator; - if (t().NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { - return t().numberTypeAnnotation(); - } else if (t().BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) { - return t().booleanTypeAnnotation(); + if (t.NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { + return t.numberTypeAnnotation(); + } else if (t.BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) { + return t.booleanTypeAnnotation(); } else if (operator === "+") { const right = this.get("right"); const left = this.get("left"); if (left.isBaseType("number") && right.isBaseType("number")) { - return t().numberTypeAnnotation(); + return t.numberTypeAnnotation(); } else if (left.isBaseType("string") || right.isBaseType("string")) { - return t().stringTypeAnnotation(); + return t.stringTypeAnnotation(); } - return t().unionTypeAnnotation([t().stringTypeAnnotation(), t().numberTypeAnnotation()]); + return t.unionTypeAnnotation([t.stringTypeAnnotation(), t.numberTypeAnnotation()]); } } function LogicalExpression() { - return t().createUnionTypeAnnotation([this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]); + const argumentTypes = [this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]; + + if (t.isTSTypeAnnotation(argumentTypes[0]) && t.createTSUnionType) { + return t.createTSUnionType(argumentTypes); + } + + if (t.createFlowUnionType) { + return t.createFlowUnionType(argumentTypes); + } + + return t.createUnionTypeAnnotation(argumentTypes); } function ConditionalExpression() { - return t().createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]); + const argumentTypes = [this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]; + + if (t.isTSTypeAnnotation(argumentTypes[0]) && t.createTSUnionType) { + return t.createTSUnionType(argumentTypes); + } + + if (t.createFlowUnionType) { + return t.createFlowUnionType(argumentTypes); + } + + return t.createUnionTypeAnnotation(argumentTypes); } function SequenceExpression() { @@ -141,36 +157,36 @@ function UpdateExpression(node) { const operator = node.operator; if (operator === "++" || operator === "--") { - return t().numberTypeAnnotation(); + return t.numberTypeAnnotation(); } } function StringLiteral() { - return t().stringTypeAnnotation(); + return t.stringTypeAnnotation(); } function NumericLiteral() { - return t().numberTypeAnnotation(); + return t.numberTypeAnnotation(); } function BooleanLiteral() { - return t().booleanTypeAnnotation(); + return t.booleanTypeAnnotation(); } function NullLiteral() { - return t().nullLiteralTypeAnnotation(); + return t.nullLiteralTypeAnnotation(); } function RegExpLiteral() { - return t().genericTypeAnnotation(t().identifier("RegExp")); + return t.genericTypeAnnotation(t.identifier("RegExp")); } function ObjectExpression() { - return t().genericTypeAnnotation(t().identifier("Object")); + return t.genericTypeAnnotation(t.identifier("Object")); } function ArrayExpression() { - return t().genericTypeAnnotation(t().identifier("Array")); + return t.genericTypeAnnotation(t.identifier("Array")); } function RestElement() { @@ -180,13 +196,13 @@ function RestElement() { RestElement.validParent = true; function Func() { - return t().genericTypeAnnotation(t().identifier("Function")); + return t.genericTypeAnnotation(t.identifier("Function")); } -const isArrayFrom = t().buildMatchMemberExpression("Array.from"); -const isObjectKeys = t().buildMatchMemberExpression("Object.keys"); -const isObjectValues = t().buildMatchMemberExpression("Object.values"); -const isObjectEntries = t().buildMatchMemberExpression("Object.entries"); +const isArrayFrom = t.buildMatchMemberExpression("Array.from"); +const isObjectKeys = t.buildMatchMemberExpression("Object.keys"); +const isObjectValues = t.buildMatchMemberExpression("Object.values"); +const isObjectEntries = t.buildMatchMemberExpression("Object.entries"); function CallExpression() { const { @@ -194,11 +210,11 @@ function CallExpression() { } = this.node; if (isObjectKeys(callee)) { - return t().arrayTypeAnnotation(t().stringTypeAnnotation()); + return t.arrayTypeAnnotation(t.stringTypeAnnotation()); } else if (isArrayFrom(callee) || isObjectValues(callee)) { - return t().arrayTypeAnnotation(t().anyTypeAnnotation()); + return t.arrayTypeAnnotation(t.anyTypeAnnotation()); } else if (isObjectEntries(callee)) { - return t().arrayTypeAnnotation(t().tupleTypeAnnotation([t().stringTypeAnnotation(), t().anyTypeAnnotation()])); + return t.arrayTypeAnnotation(t.tupleTypeAnnotation([t.stringTypeAnnotation(), t.anyTypeAnnotation()])); } return resolveCall(this.get("callee")); @@ -214,9 +230,9 @@ function resolveCall(callee) { if (callee.isFunction()) { if (callee.is("async")) { if (callee.is("generator")) { - return t().genericTypeAnnotation(t().identifier("AsyncIterator")); + return t.genericTypeAnnotation(t.identifier("AsyncIterator")); } else { - return t().genericTypeAnnotation(t().identifier("Promise")); + return t.genericTypeAnnotation(t.identifier("Promise")); } } else { if (callee.node.returnType) { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/introspection.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/introspection.js similarity index 62% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/introspection.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/introspection.js index 3eab2763b8fa69..718a6c85da0afa 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/introspection.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/introspection.js @@ -24,32 +24,14 @@ exports.isConstantExpression = isConstantExpression; exports.isInStrictMode = isInStrictMode; exports.is = void 0; -function _includes() { - const data = _interopRequireDefault(require("lodash/includes")); +var t = _interopRequireWildcard(require("@babel/types")); - _includes = function () { - return data; - }; - - return data; -} - -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function matchesPattern(pattern, allowPartial) { - return t().matchesPattern(this.node, pattern, allowPartial); + return t.matchesPattern(this.node, pattern, allowPartial); } function has(key) { @@ -78,7 +60,7 @@ function equals(key, value) { } function isNodeType(type) { - return t().isType(this.type, type); + return t.isType(this.type, type); } function canHaveVariableDeclarationOrExpression() { @@ -91,9 +73,9 @@ function canSwapBetweenExpressionAndStatement(replacement) { } if (this.isExpression()) { - return t().isBlockStatement(replacement); + return t.isBlockStatement(replacement); } else if (this.isBlockStatement()) { - return t().isExpression(replacement); + return t.isExpression(replacement); } return false; @@ -121,10 +103,10 @@ function isCompletionRecord(allowInsideFunction) { } function isStatementOrBlock() { - if (this.parentPath.isLabeledStatement() || t().isBlockStatement(this.container)) { + if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) { return false; } else { - return (0, _includes().default)(t().STATEMENT_OR_BLOCK_KEYS, this.key); + return t.STATEMENT_OR_BLOCK_KEYS.includes(this.key); } } @@ -172,81 +154,147 @@ function willIMaybeExecuteBefore(target) { return this._guessExecutionStatusRelativeTo(target) !== "after"; } -function _guessExecutionStatusRelativeTo(target) { - const targetFuncParent = target.scope.getFunctionParent() || target.scope.getProgramParent(); - const selfFuncParent = this.scope.getFunctionParent() || target.scope.getProgramParent(); +function getOuterFunction(path) { + return (path.scope.getFunctionParent() || path.scope.getProgramParent()).path; +} - if (targetFuncParent.node !== selfFuncParent.node) { - const status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent); +function isExecutionUncertain(type, key) { + switch (type) { + case "LogicalExpression": + return key === "right"; - if (status) { - return status; - } else { - target = targetFuncParent.path; + case "ConditionalExpression": + case "IfStatement": + return key === "consequent" || key === "alternate"; + + case "WhileStatement": + case "DoWhileStatement": + case "ForInStatement": + case "ForOfStatement": + return key === "body"; + + case "ForStatement": + return key === "body" || key === "update"; + + case "SwitchStatement": + return key === "cases"; + + case "TryStatement": + return key === "handler"; + + case "AssignmentPattern": + return key === "right"; + + case "OptionalMemberExpression": + return key === "property"; + + case "OptionalCallExpression": + return key === "arguments"; + + default: + return false; + } +} + +function isExecutionUncertainInList(paths, maxIndex) { + for (let i = 0; i < maxIndex; i++) { + const path = paths[i]; + + if (isExecutionUncertain(path.parent.type, path.parentKey)) { + return true; } } - const targetPaths = target.getAncestry(); - if (targetPaths.indexOf(this) >= 0) return "after"; - const selfPaths = this.getAncestry(); + return false; +} + +function _guessExecutionStatusRelativeTo(target) { + const funcParent = { + this: getOuterFunction(this), + target: getOuterFunction(target) + }; + + if (funcParent.target.node !== funcParent.this.node) { + return this._guessExecutionStatusRelativeToDifferentFunctions(funcParent.target); + } + + const paths = { + target: target.getAncestry(), + this: this.getAncestry() + }; + if (paths.target.indexOf(this) >= 0) return "after"; + if (paths.this.indexOf(target) >= 0) return "before"; let commonPath; - let targetIndex; - let selfIndex; + const commonIndex = { + target: 0, + this: 0 + }; - for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) { - const selfPath = selfPaths[selfIndex]; - targetIndex = targetPaths.indexOf(selfPath); + while (!commonPath && commonIndex.this < paths.this.length) { + const path = paths.this[commonIndex.this]; + commonIndex.target = paths.target.indexOf(path); - if (targetIndex >= 0) { - commonPath = selfPath; - break; + if (commonIndex.target >= 0) { + commonPath = path; + } else { + commonIndex.this++; } } if (!commonPath) { - return "before"; + throw new Error("Internal Babel error - The two compared nodes" + " don't appear to belong to the same program."); } - const targetRelationship = targetPaths[targetIndex - 1]; - const selfRelationship = selfPaths[selfIndex - 1]; - - if (!targetRelationship || !selfRelationship) { - return "before"; + if (isExecutionUncertainInList(paths.this, commonIndex.this - 1) || isExecutionUncertainInList(paths.target, commonIndex.target - 1)) { + return "unknown"; } - if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) { - return targetRelationship.key > selfRelationship.key ? "before" : "after"; + const divergence = { + this: paths.this[commonIndex.this - 1], + target: paths.target[commonIndex.target - 1] + }; + + if (divergence.target.listKey && divergence.this.listKey && divergence.target.container === divergence.this.container) { + return divergence.target.key > divergence.this.key ? "before" : "after"; } - const keys = t().VISITOR_KEYS[commonPath.type]; - const targetKeyPosition = keys.indexOf(targetRelationship.key); - const selfKeyPosition = keys.indexOf(selfRelationship.key); - return targetKeyPosition > selfKeyPosition ? "before" : "after"; + const keys = t.VISITOR_KEYS[commonPath.type]; + const keyPosition = { + this: keys.indexOf(divergence.this.parentKey), + target: keys.indexOf(divergence.target.parentKey) + }; + return keyPosition.target > keyPosition.this ? "before" : "after"; } -function _guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent) { - const targetFuncPath = targetFuncParent.path; - if (!targetFuncPath.isFunctionDeclaration()) return; - const binding = targetFuncPath.scope.getBinding(targetFuncPath.node.id.name); - if (!binding.references) return "before"; - const referencePaths = binding.referencePaths; +const executionOrderCheckedNodes = new WeakSet(); - for (const path of referencePaths) { - if (path.key !== "callee" || !path.parentPath.isCallExpression()) { - return; - } +function _guessExecutionStatusRelativeToDifferentFunctions(target) { + if (!target.isFunctionDeclaration() || target.parentPath.isExportDeclaration()) { + return "unknown"; } + const binding = target.scope.getBinding(target.node.id.name); + if (!binding.references) return "before"; + const referencePaths = binding.referencePaths; let allStatus; for (const path of referencePaths) { - const childOfFunction = !!path.find(path => path.node === targetFuncPath.node); + const childOfFunction = !!path.find(path => path.node === target.node); if (childOfFunction) continue; + if (path.key !== "callee" || !path.parentPath.isCallExpression()) { + return "unknown"; + } + + if (executionOrderCheckedNodes.has(path.node)) continue; + executionOrderCheckedNodes.add(path.node); + const status = this._guessExecutionStatusRelativeTo(path); - if (allStatus) { - if (allStatus !== status) return; + executionOrderCheckedNodes.delete(path.node); + + if (allStatus && allStatus !== status) { + return "unknown"; } else { allStatus = status; } @@ -283,7 +331,7 @@ function _resolve(dangerous, resolved) { return this.get("expression").resolve(dangerous, resolved); } else if (dangerous && this.isMemberExpression()) { const targetKey = this.toComputedKey(); - if (!t().isLiteral(targetKey)) return; + if (!t.isLiteral(targetKey)) return; const targetName = targetKey.value; const target = this.get("object").resolve(dangerous, resolved); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/lib/hoister.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/lib/hoister.js similarity index 74% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/lib/hoister.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/lib/hoister.js index 544d78827b0d5d..4d6644ad8668ea 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/lib/hoister.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/lib/hoister.js @@ -5,21 +5,15 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } const referenceVisitor = { ReferencedIdentifier(path, state) { - if (path.isJSXIdentifier() && t().react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) { + if (path.isJSXIdentifier() && t.react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) { return; } @@ -37,6 +31,15 @@ const referenceVisitor = { const binding = path.scope.getBinding(path.node.name); if (!binding) return; + + for (const violation of binding.constantViolations) { + if (violation.scope !== binding.path.scope) { + state.mutableBinding = true; + path.stop(); + return; + } + } + if (binding !== state.scope.getBinding(path.node.name)) return; state.bindings[path.node.name] = binding; } @@ -47,6 +50,7 @@ class PathHoister { constructor(path, scope) { this.breakOnScopePaths = []; this.bindings = {}; + this.mutableBinding = false; this.scopes = []; this.scope = scope; this.path = path; @@ -165,21 +169,22 @@ class PathHoister { run() { this.path.traverse(referenceVisitor, this); + if (this.mutableBinding) return; this.getCompatibleScopes(); const attachTo = this.getAttachmentPath(); if (!attachTo) return; if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return; let uid = attachTo.scope.generateUidIdentifier("ref"); - const declarator = t().variableDeclarator(uid, this.path.node); + const declarator = t.variableDeclarator(uid, this.path.node); const insertFn = this.attachAfter ? "insertAfter" : "insertBefore"; - const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t().variableDeclaration("var", [declarator])]); + const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t.variableDeclaration("var", [declarator])]); const parent = this.path.parentPath; if (parent.isJSXElement() && this.path.container === parent.node.children) { - uid = t().JSXExpressionContainer(uid); + uid = t.JSXExpressionContainer(uid); } - this.path.replaceWith(t().cloneNode(uid)); + this.path.replaceWith(t.cloneNode(uid)); return attachTo.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init"); } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/lib/virtual-types.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/lib/virtual-types.js similarity index 65% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/lib/virtual-types.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/lib/virtual-types.js index 2ac7cf044c2251..505e9a4493dfe6 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/lib/virtual-types.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/lib/virtual-types.js @@ -5,17 +5,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.ForAwaitStatement = exports.NumericLiteralTypeAnnotation = exports.ExistentialTypeParam = exports.SpreadProperty = exports.RestProperty = exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = void 0; -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } const ReferencedIdentifier = { types: ["Identifier", "JSXIdentifier"], @@ -26,15 +20,15 @@ const ReferencedIdentifier = { parent } = path; - if (!t().isIdentifier(node, opts) && !t().isJSXMemberExpression(parent, opts)) { - if (t().isJSXIdentifier(node, opts)) { - if (t().react.isCompatTag(node.name)) return false; + if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) { + if (t.isJSXIdentifier(node, opts)) { + if (t.react.isCompatTag(node.name)) return false; } else { return false; } } - return t().isReferenced(node, parent, path.parentPath.parent); + return t.isReferenced(node, parent, path.parentPath.parent); } }; @@ -46,7 +40,7 @@ const ReferencedMemberExpression = { node, parent }) { - return t().isMemberExpression(node) && t().isReferenced(node, parent); + return t.isMemberExpression(node) && t.isReferenced(node, parent); } }; @@ -60,7 +54,7 @@ const BindingIdentifier = { parent } = path; const grandparent = path.parentPath.parent; - return t().isIdentifier(node) && t().isBinding(node, parent, grandparent); + return t.isIdentifier(node) && t.isBinding(node, parent, grandparent); } }; @@ -72,12 +66,12 @@ const Statement = { node, parent }) { - if (t().isStatement(node)) { - if (t().isVariableDeclaration(node)) { - if (t().isForXStatement(parent, { + if (t.isStatement(node)) { + if (t.isVariableDeclaration(node)) { + if (t.isForXStatement(parent, { left: node })) return false; - if (t().isForStatement(parent, { + if (t.isForStatement(parent, { init: node })) return false; } @@ -97,31 +91,31 @@ const Expression = { if (path.isIdentifier()) { return path.isReferencedIdentifier(); } else { - return t().isExpression(path.node); + return t.isExpression(path.node); } } }; exports.Expression = Expression; const Scope = { - types: ["Scopable"], + types: ["Scopable", "Pattern"], checkPath(path) { - return t().isScope(path.node, path.parent); + return t.isScope(path.node, path.parent); } }; exports.Scope = Scope; const Referenced = { checkPath(path) { - return t().isReferenced(path.node, path.parent); + return t.isReferenced(path.node, path.parent); } }; exports.Referenced = Referenced; const BlockScoped = { checkPath(path) { - return t().isBlockScoped(path.node); + return t.isBlockScoped(path.node); } }; @@ -130,7 +124,7 @@ const Var = { types: ["VariableDeclaration"], checkPath(path) { - return t().isVar(path.node); + return t.isVar(path.node); } }; @@ -162,13 +156,13 @@ const Flow = { checkPath({ node }) { - if (t().isFlow(node)) { + if (t.isFlow(node)) { return true; - } else if (t().isImportDeclaration(node)) { + } else if (t.isImportDeclaration(node)) { return node.importKind === "type" || node.importKind === "typeof"; - } else if (t().isExportDeclaration(node)) { + } else if (t.isExportDeclaration(node)) { return node.exportKind === "type"; - } else if (t().isImportSpecifier(node)) { + } else if (t.isImportSpecifier(node)) { return node.importKind === "type" || node.importKind === "typeof"; } else { return false; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/modification.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/modification.js similarity index 79% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/modification.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/modification.js index 34cee6fb1cf745..e8bee5944c14de 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/modification.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/modification.js @@ -20,17 +20,11 @@ var _hoister = _interopRequireDefault(require("./lib/hoister")); var _index = _interopRequireDefault(require("./index")); -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -51,7 +45,7 @@ function insertBefore(nodes) { return this._containerInsertBefore(nodes); } else if (this.isStatementOrBlock()) { const shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null); - this.replaceWith(t().blockStatement(shouldInsertCurrentNode ? [this.node] : [])); + this.replaceWith(t.blockStatement(shouldInsertCurrentNode ? [this.node] : [])); return this.unshiftContainer("body", nodes); } else { throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); @@ -105,9 +99,9 @@ function insertAfter(nodes) { if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) { return parentPath.insertAfter(nodes.map(node => { - return t().isExpression(node) ? t().expressionStatement(node) : node; + return t.isExpression(node) ? t.expressionStatement(node) : node; })); - } else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") { + } else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") { if (this.node) { let { scope @@ -121,8 +115,8 @@ function insertAfter(nodes) { } const temp = scope.generateDeclaredUidIdentifier(); - nodes.unshift(t().expressionStatement(t().assignmentExpression("=", t().cloneNode(temp), this.node))); - nodes.push(t().expressionStatement(t().cloneNode(temp))); + nodes.unshift(t.expressionStatement(t.assignmentExpression("=", t.cloneNode(temp), this.node))); + nodes.push(t.expressionStatement(t.cloneNode(temp))); } return this.replaceExpressionWithStatements(nodes); @@ -130,7 +124,7 @@ function insertAfter(nodes) { return this._containerInsertAfter(nodes); } else if (this.isStatementOrBlock()) { const shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null); - this.replaceWith(t().blockStatement(shouldInsertCurrentNode ? [this.node] : [])); + this.replaceWith(t.blockStatement(shouldInsertCurrentNode ? [this.node] : [])); return this.pushContainer("body", nodes); } else { throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); @@ -142,9 +136,7 @@ function updateSiblingKeys(fromIndex, incrementBy) { const paths = _cache.path.get(this.parent); - for (let i = 0; i < paths.length; i++) { - const path = paths[i]; - + for (const [, path] of paths) { if (path.key >= fromIndex) { path.key += incrementBy; } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/removal.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/removal.js similarity index 79% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/removal.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/removal.js index d509a6de9a721c..b3c04e126c79eb 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/removal.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/removal.js @@ -12,12 +12,20 @@ exports._assertUnremoved = _assertUnremoved; var _removalHooks = require("./lib/removal-hooks"); +var _cache = require("../cache"); + +var _index = require("./index"); + function remove() { + var _this$opts; + this._assertUnremoved(); this.resync(); - this._removeFromScope(); + if (!((_this$opts = this.opts) == null ? void 0 : _this$opts.noScope)) { + this._removeFromScope(); + } if (this._callRemovalHooks()) { this._markRemoved(); @@ -53,8 +61,8 @@ function _remove() { } function _markRemoved() { - this.shouldSkip = true; - this.removed = true; + this._traverseFlags |= _index.SHOULD_SKIP | _index.REMOVED; + if (this.parent) _cache.path.get(this.parent).delete(this.node); this.node = null; } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/replacement.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/replacement.js similarity index 64% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/replacement.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/replacement.js index a204ca6ef819e2..eea4b1d7180fdb 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/replacement.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/replacement.js @@ -10,41 +10,21 @@ exports._replaceWith = _replaceWith; exports.replaceExpressionWithStatements = replaceExpressionWithStatements; exports.replaceInline = replaceInline; -function _codeFrame() { - const data = require("@babel/code-frame"); - - _codeFrame = function () { - return data; - }; - - return data; -} +var _codeFrame = require("@babel/code-frame"); var _index = _interopRequireDefault(require("../index")); var _index2 = _interopRequireDefault(require("./index")); -function _parser() { - const data = require("@babel/parser"); +var _cache = require("../cache"); - _parser = function () { - return data; - }; +var _parser = require("@babel/parser"); - return data; -} +var t = _interopRequireWildcard(require("@babel/types")); -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -67,7 +47,7 @@ const hoistVariablesVisitor = { for (const declar of path.node.declarations) { if (declar.init) { - exprs.push(t().expressionStatement(t().assignmentExpression("=", declar.id, declar.init))); + exprs.push(t.expressionStatement(t.assignmentExpression("=", declar.id, declar.init))); } } @@ -77,10 +57,13 @@ const hoistVariablesVisitor = { }; function replaceWithMultiple(nodes) { + var _pathCache$get; + this.resync(); nodes = this._verifyNodeList(nodes); - t().inheritLeadingComments(nodes[0], this.node); - t().inheritTrailingComments(nodes[nodes.length - 1], this.node); + t.inheritLeadingComments(nodes[0], this.node); + t.inheritTrailingComments(nodes[nodes.length - 1], this.node); + (_pathCache$get = _cache.path.get(this.parent)) == null ? void 0 : _pathCache$get.delete(this.node); this.node = this.container[this.key] = null; const paths = this.insertAfter(nodes); @@ -98,12 +81,12 @@ function replaceWithSourceString(replacement) { try { replacement = `(${replacement})`; - replacement = (0, _parser().parse)(replacement); + replacement = (0, _parser.parse)(replacement); } catch (err) { const loc = err.loc; if (loc) { - err.message += " - make sure this is an expression.\n" + (0, _codeFrame().codeFrameColumns)(replacement, { + err.message += " - make sure this is an expression.\n" + (0, _codeFrame.codeFrameColumns)(replacement, { start: { line: loc.line, column: loc.column + 1 @@ -141,7 +124,7 @@ function replaceWith(replacement) { return [this]; } - if (this.isProgram() && !t().isProgram(replacement)) { + if (this.isProgram() && !t.isProgram(replacement)) { throw new Error("You can only replace a Program root node with another Program node"); } @@ -155,14 +138,14 @@ function replaceWith(replacement) { let nodePath = ""; - if (this.isNodeType("Statement") && t().isExpression(replacement)) { + if (this.isNodeType("Statement") && t.isExpression(replacement)) { if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) { - replacement = t().expressionStatement(replacement); + replacement = t.expressionStatement(replacement); nodePath = "expression"; } } - if (this.isNodeType("Expression") && t().isStatement(replacement)) { + if (this.isNodeType("Expression") && t.isStatement(replacement)) { if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) { return this.replaceExpressionWithStatements([replacement]); } @@ -171,8 +154,8 @@ function replaceWith(replacement) { const oldNode = this.node; if (oldNode) { - t().inheritsComments(replacement, oldNode); - t().removeComments(oldNode); + t.inheritsComments(replacement, oldNode); + t.removeComments(oldNode); } this._replaceWith(replacement); @@ -184,32 +167,35 @@ function replaceWith(replacement) { } function _replaceWith(node) { + var _pathCache$get2; + if (!this.container) { throw new ReferenceError("Container is falsy"); } if (this.inList) { - t().validate(this.parent, this.key, [node]); + t.validate(this.parent, this.key, [node]); } else { - t().validate(this.parent, this.key, node); + t.validate(this.parent, this.key, node); } - this.debug(`Replace with ${node && node.type}`); + this.debug(`Replace with ${node == null ? void 0 : node.type}`); + (_pathCache$get2 = _cache.path.get(this.parent)) == null ? void 0 : _pathCache$get2.set(node, this).delete(this.node); this.node = this.container[this.key] = node; } function replaceExpressionWithStatements(nodes) { this.resync(); - const toSequenceExpression = t().toSequenceExpression(nodes, this.scope); + const toSequenceExpression = t.toSequenceExpression(nodes, this.scope); if (toSequenceExpression) { return this.replaceWith(toSequenceExpression)[0].get("expressions"); } const functionParent = this.getFunctionParent(); - const isParentAsync = functionParent && functionParent.is("async"); - const container = t().arrowFunctionExpression([], t().blockStatement(nodes)); - this.replaceWith(t().callExpression(container, [])); + const isParentAsync = functionParent == null ? void 0 : functionParent.is("async"); + const container = t.arrowFunctionExpression([], t.blockStatement(nodes)); + this.replaceWith(t.callExpression(container, [])); this.traverse(hoistVariablesVisitor); const completionRecords = this.get("callee").getCompletionRecords(); @@ -223,24 +209,24 @@ function replaceExpressionWithStatements(nodes) { if (!uid) { const callee = this.get("callee"); uid = callee.scope.generateDeclaredUidIdentifier("ret"); - callee.get("body").pushContainer("body", t().returnStatement(t().cloneNode(uid))); + callee.get("body").pushContainer("body", t.returnStatement(t.cloneNode(uid))); loop.setData("expressionReplacementReturnUid", uid); } else { - uid = t().identifier(uid.name); + uid = t.identifier(uid.name); } - path.get("expression").replaceWith(t().assignmentExpression("=", t().cloneNode(uid), path.node.expression)); + path.get("expression").replaceWith(t.assignmentExpression("=", t.cloneNode(uid), path.node.expression)); } else { - path.replaceWith(t().returnStatement(path.node.expression)); + path.replaceWith(t.returnStatement(path.node.expression)); } } const callee = this.get("callee"); callee.arrowFunctionToExpression(); - if (isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", t().FUNCTION_TYPES)) { + if (isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", t.FUNCTION_TYPES)) { callee.set("async", true); - this.replaceWith(t().awaitExpression(this.node)); + this.replaceWith(t.awaitExpression(this.node)); } return callee.get("body.body"); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/scope/binding.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/scope/binding.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/scope/binding.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/scope/binding.js index d19f1168d77bbf..50ce03b9495174 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/scope/binding.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/scope/binding.js @@ -12,15 +12,15 @@ class Binding { path, kind }) { - this.identifier = identifier; - this.scope = scope; - this.path = path; - this.kind = kind; this.constantViolations = []; this.constant = true; this.referencePaths = []; this.referenced = false; this.references = 0; + this.identifier = identifier; + this.scope = scope; + this.path = path; + this.kind = kind; this.clearValue(); } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/scope/index.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/scope/index.js similarity index 64% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/scope/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/scope/index.js index b27f22678a4e63..165f79a02fe1ec 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/scope/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/scope/index.js @@ -5,106 +5,168 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -function _includes() { - const data = _interopRequireDefault(require("lodash/includes")); - - _includes = function () { - return data; - }; - - return data; -} - -function _repeat() { - const data = _interopRequireDefault(require("lodash/repeat")); - - _repeat = function () { - return data; - }; - - return data; -} - var _renamer = _interopRequireDefault(require("./lib/renamer")); var _index = _interopRequireDefault(require("../index")); -function _defaults() { - const data = _interopRequireDefault(require("lodash/defaults")); - - _defaults = function () { - return data; - }; - - return data; -} - var _binding = _interopRequireDefault(require("./binding")); -function _globals() { - const data = _interopRequireDefault(require("globals")); - - _globals = function () { - return data; - }; - - return data; -} - -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var _globals = _interopRequireDefault(require("globals")); - t = function () { - return data; - }; - - return data; -} +var t = _interopRequireWildcard(require("@babel/types")); var _cache = require("../cache"); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function gatherNodeParts(node, parts) { - if (t().isModuleDeclaration(node)) { - if (node.source) { - gatherNodeParts(node.source, parts); - } else if (node.specifiers && node.specifiers.length) { - for (const specifier of node.specifiers) { - gatherNodeParts(specifier, parts); + switch (node == null ? void 0 : node.type) { + default: + if (t.isModuleDeclaration(node)) { + if (node.source) { + gatherNodeParts(node.source, parts); + } else if (node.specifiers && node.specifiers.length) { + for (const e of node.specifiers) gatherNodeParts(e, parts); + } else if (node.declaration) { + gatherNodeParts(node.declaration, parts); + } + } else if (t.isModuleSpecifier(node)) { + gatherNodeParts(node.local, parts); + } else if (t.isLiteral(node)) { + parts.push(node.value); + } + + break; + + case "MemberExpression": + case "OptionalMemberExpression": + case "JSXMemberExpression": + gatherNodeParts(node.object, parts); + gatherNodeParts(node.property, parts); + break; + + case "Identifier": + case "JSXIdentifier": + parts.push(node.name); + break; + + case "CallExpression": + case "OptionalCallExpression": + case "NewExpression": + gatherNodeParts(node.callee, parts); + break; + + case "ObjectExpression": + case "ObjectPattern": + for (const e of node.properties) { + gatherNodeParts(e, parts); } - } else if (node.declaration) { - gatherNodeParts(node.declaration, parts); - } - } else if (t().isModuleSpecifier(node)) { - gatherNodeParts(node.local, parts); - } else if (t().isMemberExpression(node)) { - gatherNodeParts(node.object, parts); - gatherNodeParts(node.property, parts); - } else if (t().isIdentifier(node)) { - parts.push(node.name); - } else if (t().isLiteral(node)) { - parts.push(node.value); - } else if (t().isCallExpression(node)) { - gatherNodeParts(node.callee, parts); - } else if (t().isObjectExpression(node) || t().isObjectPattern(node)) { - for (const prop of node.properties) { - gatherNodeParts(prop.key || prop.argument, parts); - } - } else if (t().isPrivateName(node)) { - gatherNodeParts(node.id, parts); - } else if (t().isThisExpression(node)) { - parts.push("this"); - } else if (t().isSuper(node)) { - parts.push("super"); + + break; + + case "SpreadElement": + case "RestElement": + gatherNodeParts(node.argument, parts); + break; + + case "ObjectProperty": + case "ObjectMethod": + case "ClassProperty": + case "ClassMethod": + case "ClassPrivateProperty": + case "ClassPrivateMethod": + gatherNodeParts(node.key, parts); + break; + + case "ThisExpression": + parts.push("this"); + break; + + case "Super": + parts.push("super"); + break; + + case "Import": + parts.push("import"); + break; + + case "DoExpression": + parts.push("do"); + break; + + case "YieldExpression": + parts.push("yield"); + gatherNodeParts(node.argument, parts); + break; + + case "AwaitExpression": + parts.push("await"); + gatherNodeParts(node.argument, parts); + break; + + case "AssignmentExpression": + gatherNodeParts(node.left, parts); + break; + + case "VariableDeclarator": + gatherNodeParts(node.id, parts); + break; + + case "FunctionExpression": + case "FunctionDeclaration": + case "ClassExpression": + case "ClassDeclaration": + gatherNodeParts(node.id, parts); + break; + + case "PrivateName": + gatherNodeParts(node.id, parts); + break; + + case "ParenthesizedExpression": + gatherNodeParts(node.expression, parts); + break; + + case "UnaryExpression": + case "UpdateExpression": + gatherNodeParts(node.argument, parts); + break; + + case "MetaProperty": + gatherNodeParts(node.meta, parts); + gatherNodeParts(node.property, parts); + break; + + case "JSXElement": + gatherNodeParts(node.openingElement, parts); + break; + + case "JSXOpeningElement": + parts.push(node.name); + break; + + case "JSXFragment": + gatherNodeParts(node.openingFragment, parts); + break; + + case "JSXOpeningFragment": + parts.push("Fragment"); + break; + + case "JSXNamespacedName": + gatherNodeParts(node.namespace, parts); + gatherNodeParts(node.name, parts); + break; } } const collectorVisitor = { For(path) { - for (const key of t().FOR_INIT_KEYS) { + for (const key of t.FOR_INIT_KEYS) { const declar = path.get(key); if (declar.isVar()) { @@ -145,14 +207,14 @@ const collectorVisitor = { } = path; const declar = node.declaration; - if (t().isClassDeclaration(declar) || t().isFunctionDeclaration(declar)) { + if (t.isClassDeclaration(declar) || t.isFunctionDeclaration(declar)) { const id = declar.id; if (!id) return; const binding = scope.getBinding(id.name); if (binding) binding.reference(path); - } else if (t().isVariableDeclaration(declar)) { + } else if (t.isVariableDeclaration(declar)) { for (const decl of declar.declarations) { - for (const name of Object.keys(t().getBindingIdentifiers(decl))) { + for (const name of Object.keys(t.getBindingIdentifiers(decl))) { const binding = scope.getBinding(name); if (binding) binding.reference(path); } @@ -184,14 +246,14 @@ const collectorVisitor = { BlockScoped(path) { let scope = path.scope; if (scope.path === path) scope = scope.parent; - scope.getBlockParent().registerDeclaration(path); - }, + const parent = scope.getBlockParent(); + parent.registerDeclaration(path); - ClassDeclaration(path) { - const id = path.node.id; - if (!id) return; - const name = id.name; - path.scope.bindings[name] = path.scope.getBinding(name); + if (path.isClassDeclaration() && path.node.id) { + const id = path.node.id; + const name = id.name; + path.scope.bindings[name] = path.scope.parent.getBinding(name); + } }, Block(path) { @@ -202,6 +264,28 @@ const collectorVisitor = { path.scope.getBlockParent().registerDeclaration(bodyPath); } } + }, + + CatchClause(path) { + path.scope.registerBinding("let", path); + }, + + Function(path) { + if (path.isFunctionExpression() && path.has("id") && !path.get("id").node[t.NOT_LOCAL_BINDING]) { + path.scope.registerBinding("local", path.get("id"), path); + } + + const params = path.get("params"); + + for (const param of params) { + path.scope.registerBinding("param", param); + } + }, + + ClassExpression(path) { + if (path.has("id") && !path.get("id").node[t.NOT_LOCAL_BINDING]) { + path.scope.registerBinding("local", path); + } } }; @@ -215,7 +299,7 @@ class Scope { const cached = _cache.scope.get(node); - if (cached && cached.path === path) { + if ((cached == null ? void 0 : cached.path) === path) { return cached; } @@ -225,11 +309,12 @@ class Scope { this.block = node; this.path = path; this.labels = new Map(); + this.inited = false; } get parent() { const parent = this.path.findParent(p => p.isScope()); - return parent && parent.scope; + return parent == null ? void 0 : parent.scope; } get parentBlock() { @@ -249,17 +334,17 @@ class Scope { this.push({ id }); - return t().cloneNode(id); + return t.cloneNode(id); } generateUidIdentifier(name) { - return t().identifier(this.generateUid(name)); + return t.identifier(this.generateUid(name)); } generateUid(name = "temp") { - name = t().toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, ""); + name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, ""); let uid; - let i = 0; + let i = 1; do { uid = this._generateUid(name, i); @@ -278,17 +363,7 @@ class Scope { return `_${id}`; } - generateUidBasedOnNode(parent, defaultName) { - let node = parent; - - if (t().isAssignmentExpression(parent)) { - node = parent.left; - } else if (t().isVariableDeclarator(parent)) { - node = parent.id; - } else if (t().isObjectProperty(node) || t().isObjectMethod(node)) { - node = node.key; - } - + generateUidBasedOnNode(node, defaultName) { const parts = []; gatherNodeParts(node, parts); let id = parts.join("$"); @@ -296,16 +371,16 @@ class Scope { return this.generateUid(id.slice(0, 20)); } - generateUidIdentifierBasedOnNode(parent, defaultName) { - return t().identifier(this.generateUidBasedOnNode(parent, defaultName)); + generateUidIdentifierBasedOnNode(node, defaultName) { + return t.identifier(this.generateUidBasedOnNode(node, defaultName)); } isStatic(node) { - if (t().isThisExpression(node) || t().isSuper(node)) { + if (t.isThisExpression(node) || t.isSuper(node)) { return true; } - if (t().isIdentifier(node)) { + if (t.isIdentifier(node)) { const binding = this.getBinding(node.name); if (binding) { @@ -328,7 +403,7 @@ class Scope { this.push({ id }); - return t().cloneNode(id); + return t.cloneNode(id); } return id; @@ -362,7 +437,7 @@ class Scope { } dump() { - const sep = (0, _repeat().default)("-", 60); + const sep = "-".repeat(60); console.log(sep); let scope = this; @@ -383,23 +458,23 @@ class Scope { console.log(sep); } - toArray(node, i) { - if (t().isIdentifier(node)) { + toArray(node, i, allowArrayLike) { + if (t.isIdentifier(node)) { const binding = this.getBinding(node.name); - if (binding && binding.constant && binding.path.isGenericType("Array")) { + if ((binding == null ? void 0 : binding.constant) && binding.path.isGenericType("Array")) { return node; } } - if (t().isArrayExpression(node)) { + if (t.isArrayExpression(node)) { return node; } - if (t().isIdentifier(node, { + if (t.isIdentifier(node, { name: "arguments" })) { - return t().callExpression(t().memberExpression(t().memberExpression(t().memberExpression(t().identifier("Array"), t().identifier("prototype")), t().identifier("slice")), t().identifier("call")), [node]); + return t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier("Array"), t.identifier("prototype")), t.identifier("slice")), t.identifier("call")), [node]); } let helperName; @@ -408,13 +483,18 @@ class Scope { if (i === true) { helperName = "toConsumableArray"; } else if (i) { - args.push(t().numericLiteral(i)); + args.push(t.numericLiteral(i)); helperName = "slicedToArray"; } else { helperName = "toArray"; } - return t().callExpression(this.hub.addHelper(helperName), args); + if (allowArrayLike) { + args.unshift(this.hub.addHelper(helperName)); + helperName = "maybeArrayLike"; + } + + return t.callExpression(this.hub.addHelper(helperName), args); } hasLabel(name) { @@ -460,11 +540,7 @@ class Scope { } buildUndefinedNode() { - if (this.hasBinding("undefined")) { - return t().unaryExpression("void", t().numericLiteral(0), true); - } else { - return t().identifier("undefined"); - } + return t.unaryExpression("void", t.numericLiteral(0), true); } registerConstantViolation(path) { @@ -493,6 +569,8 @@ class Scope { const ids = path.getOuterBindingIdentifiers(true); for (const name of Object.keys(ids)) { + parent.references[name] = true; + for (const id of ids[name]) { const local = this.getOwnBinding(name); @@ -501,8 +579,6 @@ class Scope { this.checkBlockScopedCollisions(local, kind, name, id); } - parent.references[name] = true; - if (local) { this.registerConstantViolation(bindingPath); } else { @@ -542,66 +618,60 @@ class Scope { } hasReference(name) { - let scope = this; - - do { - if (scope.references[name]) return true; - } while (scope = scope.parent); - - return false; + return !!this.getProgramParent().references[name]; } isPure(node, constantsOnly) { - if (t().isIdentifier(node)) { + if (t.isIdentifier(node)) { const binding = this.getBinding(node.name); if (!binding) return false; if (constantsOnly) return binding.constant; return true; - } else if (t().isClass(node)) { + } else if (t.isClass(node)) { if (node.superClass && !this.isPure(node.superClass, constantsOnly)) { return false; } return this.isPure(node.body, constantsOnly); - } else if (t().isClassBody(node)) { + } else if (t.isClassBody(node)) { for (const method of node.body) { if (!this.isPure(method, constantsOnly)) return false; } return true; - } else if (t().isBinary(node)) { + } else if (t.isBinary(node)) { return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly); - } else if (t().isArrayExpression(node)) { + } else if (t.isArrayExpression(node)) { for (const elem of node.elements) { if (!this.isPure(elem, constantsOnly)) return false; } return true; - } else if (t().isObjectExpression(node)) { + } else if (t.isObjectExpression(node)) { for (const prop of node.properties) { if (!this.isPure(prop, constantsOnly)) return false; } return true; - } else if (t().isClassMethod(node)) { + } else if (t.isMethod(node)) { if (node.computed && !this.isPure(node.key, constantsOnly)) return false; if (node.kind === "get" || node.kind === "set") return false; return true; - } else if (t().isProperty(node)) { + } else if (t.isProperty(node)) { if (node.computed && !this.isPure(node.key, constantsOnly)) return false; return this.isPure(node.value, constantsOnly); - } else if (t().isUnaryExpression(node)) { + } else if (t.isUnaryExpression(node)) { return this.isPure(node.argument, constantsOnly); - } else if (t().isTaggedTemplateExpression(node)) { - return t().matchesPattern(node.tag, "String.raw") && !this.hasBinding("String", true) && this.isPure(node.quasi, constantsOnly); - } else if (t().isTemplateLiteral(node)) { + } else if (t.isTaggedTemplateExpression(node)) { + return t.matchesPattern(node.tag, "String.raw") && !this.hasBinding("String", true) && this.isPure(node.quasi, constantsOnly); + } else if (t.isTemplateLiteral(node)) { for (const expression of node.expressions) { if (!this.isPure(expression, constantsOnly)) return false; } return true; } else { - return t().isPureish(node); + return t.isPureish(node); } } @@ -628,7 +698,10 @@ class Scope { } init() { - if (!this.references) this.crawl(); + if (!this.inited) { + this.inited = true; + this.crawl(); + } } crawl() { @@ -639,26 +712,11 @@ class Scope { this.uids = Object.create(null); this.data = Object.create(null); - if (path.isLoop()) { - for (const key of t().FOR_INIT_KEYS) { - const node = path.get(key); - if (node.isBlockScoped()) this.registerBinding(node.node.kind, node); - } - } - - if (path.isFunctionExpression() && path.has("id")) { - if (!path.get("id").node[t().NOT_LOCAL_BINDING]) { + if (path.isFunction()) { + if (path.isFunctionExpression() && path.has("id") && !path.get("id").node[t.NOT_LOCAL_BINDING]) { this.registerBinding("local", path.get("id"), path); } - } - - if (path.isClassExpression() && path.has("id")) { - if (!path.get("id").node[t().NOT_LOCAL_BINDING]) { - this.registerBinding("local", path); - } - } - if (path.isFunction()) { const params = path.get("params"); for (const param of params) { @@ -666,12 +724,8 @@ class Scope { } } - if (path.isCatchClause()) { - this.registerBinding("let", path); - } - - const parent = this.getProgramParent(); - if (parent.crawling) return; + const programParent = this.getProgramParent(); + if (programParent.crawling) return; const state = { references: [], constantViolations: [], @@ -683,11 +737,9 @@ class Scope { for (const path of state.assignments) { const ids = path.getBindingIdentifiers(); - let programParent; for (const name of Object.keys(ids)) { if (path.scope.getBinding(name)) continue; - programParent = programParent || path.scope.getProgramParent(); programParent.addGlobal(ids[name]); } @@ -700,7 +752,7 @@ class Scope { if (binding) { binding.reference(ref); } else { - ref.scope.getProgramParent().addGlobal(ref.node); + programParent.addGlobal(ref.node); } } @@ -732,13 +784,13 @@ class Scope { let declarPath = !unique && path.getData(dataKey); if (!declarPath) { - const declar = t().variableDeclaration(kind, []); + const declar = t.variableDeclaration(kind, []); declar._blockHoist = blockHoist; [declarPath] = path.unshiftContainer("body", [declar]); if (!unique) path.setData(dataKey, declarPath); } - const declarator = t().variableDeclarator(opts.id, opts.init); + const declarator = t.variableDeclarator(opts.id, opts.init); declarPath.node.declarations.push(declarator); this.registerBinding(kind, declarPath.get("declarations").pop()); } @@ -784,7 +836,12 @@ class Scope { let scope = this; do { - (0, _defaults().default)(ids, scope.bindings); + for (const key of Object.keys(scope.bindings)) { + if (key in ids === false) { + ids[key] = scope.bindings[key]; + } + } + scope = scope.parent; } while (scope); @@ -816,10 +873,20 @@ class Scope { getBinding(name) { let scope = this; + let previousPath; do { const binding = scope.getOwnBinding(name); - if (binding) return binding; + + if (binding) { + var _previousPath; + + if (((_previousPath = previousPath) == null ? void 0 : _previousPath.isPattern()) && binding.kind !== "param") {} else { + return binding; + } + } + + previousPath = scope.path; } while (scope = scope.parent); } @@ -828,13 +895,14 @@ class Scope { } getBindingIdentifier(name) { - const info = this.getBinding(name); - return info && info.identifier; + var _this$getBinding; + + return (_this$getBinding = this.getBinding(name)) == null ? void 0 : _this$getBinding.identifier; } getOwnBindingIdentifier(name) { const binding = this.bindings[name]; - return binding && binding.identifier; + return binding == null ? void 0 : binding.identifier; } hasOwnBinding(name) { @@ -846,13 +914,15 @@ class Scope { if (this.hasOwnBinding(name)) return true; if (this.parentHasBinding(name, noGlobals)) return true; if (this.hasUid(name)) return true; - if (!noGlobals && (0, _includes().default)(Scope.globals, name)) return true; - if (!noGlobals && (0, _includes().default)(Scope.contextVariables, name)) return true; + if (!noGlobals && Scope.globals.includes(name)) return true; + if (!noGlobals && Scope.contextVariables.includes(name)) return true; return false; } parentHasBinding(name, noGlobals) { - return this.parent && this.parent.hasBinding(name, noGlobals); + var _this$parent; + + return (_this$parent = this.parent) == null ? void 0 : _this$parent.hasBinding(name, noGlobals); } moveBindingTo(name, scope) { @@ -870,12 +940,9 @@ class Scope { } removeBinding(name) { - const info = this.getBinding(name); - - if (info) { - info.scope.removeOwnBinding(name); - } + var _this$getBinding2; + (_this$getBinding2 = this.getBinding(name)) == null ? void 0 : _this$getBinding2.scope.removeOwnBinding(name); let scope = this; do { @@ -888,5 +955,5 @@ class Scope { } exports.default = Scope; -Scope.globals = Object.keys(_globals().default.builtin); +Scope.globals = Object.keys(_globals.default.builtin); Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"]; \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/scope/lib/renamer.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/scope/lib/renamer.js similarity index 62% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/scope/lib/renamer.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/scope/lib/renamer.js index b7a10ec69c80f0..6d1bb1847f437e 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/scope/lib/renamer.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/scope/lib/renamer.js @@ -7,27 +7,13 @@ exports.default = void 0; var _binding = _interopRequireDefault(require("../binding")); -function _helperSplitExportDeclaration() { - const data = _interopRequireDefault(require("@babel/helper-split-export-declaration")); +var _helperSplitExportDeclaration = _interopRequireDefault(require("@babel/helper-split-export-declaration")); - _helperSplitExportDeclaration = function () { - return data; - }; +var t = _interopRequireWildcard(require("@babel/types")); - return data; -} - -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -46,7 +32,8 @@ const renameVisitor = { } }, - "AssignmentExpression|Declaration"(path, state) { + "AssignmentExpression|Declaration|VariableDeclarator"(path, state) { + if (path.isVariableDeclaration()) return; const ids = path.getOuterBindingIdentifiers(); for (const name in ids) { @@ -74,27 +61,27 @@ class Renamer { return; } - (0, _helperSplitExportDeclaration().default)(maybeExportDeclar); + (0, _helperSplitExportDeclaration.default)(maybeExportDeclar); } maybeConvertFromClassFunctionDeclaration(path) { return; if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return; if (this.binding.kind !== "hoisted") return; - path.node.id = t().identifier(this.oldName); + path.node.id = t.identifier(this.oldName); path.node._blockHoist = 3; - path.replaceWith(t().variableDeclaration("let", [t().variableDeclarator(t().identifier(this.newName), t().toExpression(path.node))])); + path.replaceWith(t.variableDeclaration("let", [t.variableDeclarator(t.identifier(this.newName), t.toExpression(path.node))])); } maybeConvertFromClassFunctionExpression(path) { return; if (!path.isFunctionExpression() && !path.isClassExpression()) return; if (this.binding.kind !== "local") return; - path.node.id = t().identifier(this.oldName); + path.node.id = t.identifier(this.oldName); this.binding.scope.parent.push({ - id: t().identifier(this.newName) + id: t.identifier(this.newName) }); - path.replaceWith(t().assignmentExpression("=", t().identifier(this.newName), path.node)); + path.replaceWith(t.assignmentExpression("=", t.identifier(this.newName), path.node)); } rename(block) { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/visitors.js b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/visitors.js similarity index 80% rename from tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/visitors.js rename to tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/visitors.js index 7483fe17353dee..2a9ea697138275 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/visitors.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/lib/visitors.js @@ -9,29 +9,11 @@ exports.merge = merge; var virtualTypes = _interopRequireWildcard(require("./path/lib/virtual-types")); -function t() { - const data = _interopRequireWildcard(require("@babel/types")); +var t = _interopRequireWildcard(require("@babel/types")); - t = function () { - return data; - }; - - return data; -} +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } -function _clone() { - const data = _interopRequireDefault(require("lodash/clone")); - - _clone = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function explode(visitor) { if (visitor._exploded) return visitor; @@ -82,8 +64,8 @@ function explode(visitor) { for (const nodeType of Object.keys(visitor)) { if (shouldIgnoreKey(nodeType)) continue; const fns = visitor[nodeType]; - let aliases = t().FLIPPED_ALIAS_KEYS[nodeType]; - const deprecratedKey = t().DEPRECATED_KEYS[nodeType]; + let aliases = t.FLIPPED_ALIAS_KEYS[nodeType]; + const deprecratedKey = t.DEPRECATED_KEYS[nodeType]; if (deprecratedKey) { console.trace(`Visitor defined for ${nodeType} but it has been renamed to ${deprecratedKey}`); @@ -99,7 +81,7 @@ function explode(visitor) { if (existing) { mergePair(existing, fns); } else { - visitor[alias] = (0, _clone().default)(fns); + visitor[alias] = Object.assign({}, fns); } } } @@ -126,7 +108,7 @@ function verify(visitor) { if (shouldIgnoreKey(nodeType)) continue; - if (t().TYPES.indexOf(nodeType) < 0) { + if (t.TYPES.indexOf(nodeType) < 0) { throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type`); } @@ -198,6 +180,10 @@ function wrapWithStateOrWrapper(oldVisitor, state, wrapper) { newFn = wrapper(state.key, key, newFn); } + if (newFn !== fn) { + newFn.toString = () => fn.toString(); + } + return newFn; }); newVisitor[key] = fns; @@ -240,7 +226,7 @@ function shouldIgnoreKey(key) { if (key[0] === "_") return true; if (key === "enter" || key === "exit" || key === "shouldSkip") return true; - if (key === "blacklist" || key === "noScope" || key === "skipKeys") { + if (key === "denylist" || key === "noScope" || key === "skipKeys" || key === "blacklist") { return true; } diff --git a/tools/node_modules/@babel/core/node_modules/@babel/traverse/package.json b/tools/node_modules/@babel/core/node_modules/@babel/traverse/package.json new file mode 100644 index 00000000000000..3a875cf867494a --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/traverse/package.json @@ -0,0 +1,31 @@ +{ + "name": "@babel/traverse", + "version": "7.12.9", + "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", + "author": "Sebastian McKenzie ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-traverse" + }, + "main": "lib/index.js", + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + }, + "devDependencies": { + "@babel/helper-plugin-test-runner": "7.10.4" + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/LICENSE b/tools/node_modules/@babel/core/node_modules/@babel/types/LICENSE new file mode 100644 index 00000000000000..f31575ec773bb1 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/LICENSE @@ -0,0 +1,22 @@ +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/tools/node_modules/@babel/core/node_modules/@babel/types/README.md b/tools/node_modules/@babel/core/node_modules/@babel/types/README.md new file mode 100644 index 00000000000000..0071bd7a9bc537 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/README.md @@ -0,0 +1,19 @@ +# @babel/types + +> Babel Types is a Lodash-esque utility library for AST nodes + +See our website [@babel/types](https://babeljs.io/docs/en/babel-types) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/types +``` + +or using yarn: + +```sh +yarn add @babel/types --dev +``` diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/assertNode.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/asserts/assertNode.js similarity index 75% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/assertNode.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/asserts/assertNode.js index 194ec716814276..e28a9e0f51befb 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/assertNode.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/asserts/assertNode.js @@ -11,7 +11,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function assertNode(node) { if (!(0, _isNode.default)(node)) { - const type = node && node.type || JSON.stringify(node); + var _node$type; + + const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node); throw new TypeError(`Not a valid node of type "${type}"`); } } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/generated/index.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/asserts/generated/index.js similarity index 92% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/generated/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/asserts/generated/index.js index a9f59b08ad8997..659c4196f3e3fc 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/asserts/generated/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/asserts/generated/index.js @@ -58,8 +58,8 @@ exports.assertAssignmentPattern = assertAssignmentPattern; exports.assertArrayPattern = assertArrayPattern; exports.assertArrowFunctionExpression = assertArrowFunctionExpression; exports.assertClassBody = assertClassBody; -exports.assertClassDeclaration = assertClassDeclaration; exports.assertClassExpression = assertClassExpression; +exports.assertClassDeclaration = assertClassDeclaration; exports.assertExportAllDeclaration = assertExportAllDeclaration; exports.assertExportDefaultDeclaration = assertExportDefaultDeclaration; exports.assertExportNamedDeclaration = assertExportNamedDeclaration; @@ -78,6 +78,12 @@ exports.assertTaggedTemplateExpression = assertTaggedTemplateExpression; exports.assertTemplateElement = assertTemplateElement; exports.assertTemplateLiteral = assertTemplateLiteral; exports.assertYieldExpression = assertYieldExpression; +exports.assertAwaitExpression = assertAwaitExpression; +exports.assertImport = assertImport; +exports.assertBigIntLiteral = assertBigIntLiteral; +exports.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier; +exports.assertOptionalMemberExpression = assertOptionalMemberExpression; +exports.assertOptionalCallExpression = assertOptionalCallExpression; exports.assertAnyTypeAnnotation = assertAnyTypeAnnotation; exports.assertArrayTypeAnnotation = assertArrayTypeAnnotation; exports.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation; @@ -119,6 +125,7 @@ exports.assertOpaqueType = assertOpaqueType; exports.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier; exports.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation; exports.assertStringTypeAnnotation = assertStringTypeAnnotation; +exports.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation; exports.assertThisTypeAnnotation = assertThisTypeAnnotation; exports.assertTupleTypeAnnotation = assertTupleTypeAnnotation; exports.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation; @@ -131,6 +138,15 @@ exports.assertTypeParameterInstantiation = assertTypeParameterInstantiation; exports.assertUnionTypeAnnotation = assertUnionTypeAnnotation; exports.assertVariance = assertVariance; exports.assertVoidTypeAnnotation = assertVoidTypeAnnotation; +exports.assertEnumDeclaration = assertEnumDeclaration; +exports.assertEnumBooleanBody = assertEnumBooleanBody; +exports.assertEnumNumberBody = assertEnumNumberBody; +exports.assertEnumStringBody = assertEnumStringBody; +exports.assertEnumSymbolBody = assertEnumSymbolBody; +exports.assertEnumBooleanMember = assertEnumBooleanMember; +exports.assertEnumNumberMember = assertEnumNumberMember; +exports.assertEnumStringMember = assertEnumStringMember; +exports.assertEnumDefaultedMember = assertEnumDefaultedMember; exports.assertJSXAttribute = assertJSXAttribute; exports.assertJSXClosingElement = assertJSXClosingElement; exports.assertJSXElement = assertJSXElement; @@ -148,24 +164,24 @@ exports.assertJSXOpeningFragment = assertJSXOpeningFragment; exports.assertJSXClosingFragment = assertJSXClosingFragment; exports.assertNoop = assertNoop; exports.assertPlaceholder = assertPlaceholder; +exports.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier; exports.assertArgumentPlaceholder = assertArgumentPlaceholder; -exports.assertAwaitExpression = assertAwaitExpression; exports.assertBindExpression = assertBindExpression; exports.assertClassProperty = assertClassProperty; -exports.assertOptionalMemberExpression = assertOptionalMemberExpression; exports.assertPipelineTopicExpression = assertPipelineTopicExpression; exports.assertPipelineBareFunction = assertPipelineBareFunction; exports.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference; -exports.assertOptionalCallExpression = assertOptionalCallExpression; exports.assertClassPrivateProperty = assertClassPrivateProperty; exports.assertClassPrivateMethod = assertClassPrivateMethod; -exports.assertImport = assertImport; +exports.assertImportAttribute = assertImportAttribute; exports.assertDecorator = assertDecorator; exports.assertDoExpression = assertDoExpression; exports.assertExportDefaultSpecifier = assertExportDefaultSpecifier; -exports.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier; exports.assertPrivateName = assertPrivateName; -exports.assertBigIntLiteral = assertBigIntLiteral; +exports.assertRecordExpression = assertRecordExpression; +exports.assertTupleExpression = assertTupleExpression; +exports.assertDecimalLiteral = assertDecimalLiteral; +exports.assertStaticBlock = assertStaticBlock; exports.assertTSParameterProperty = assertTSParameterProperty; exports.assertTSDeclareFunction = assertTSDeclareFunction; exports.assertTSDeclareMethod = assertTSDeclareMethod; @@ -176,16 +192,18 @@ exports.assertTSPropertySignature = assertTSPropertySignature; exports.assertTSMethodSignature = assertTSMethodSignature; exports.assertTSIndexSignature = assertTSIndexSignature; exports.assertTSAnyKeyword = assertTSAnyKeyword; -exports.assertTSUnknownKeyword = assertTSUnknownKeyword; +exports.assertTSBooleanKeyword = assertTSBooleanKeyword; +exports.assertTSBigIntKeyword = assertTSBigIntKeyword; +exports.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword; +exports.assertTSNeverKeyword = assertTSNeverKeyword; +exports.assertTSNullKeyword = assertTSNullKeyword; exports.assertTSNumberKeyword = assertTSNumberKeyword; exports.assertTSObjectKeyword = assertTSObjectKeyword; -exports.assertTSBooleanKeyword = assertTSBooleanKeyword; exports.assertTSStringKeyword = assertTSStringKeyword; exports.assertTSSymbolKeyword = assertTSSymbolKeyword; -exports.assertTSVoidKeyword = assertTSVoidKeyword; exports.assertTSUndefinedKeyword = assertTSUndefinedKeyword; -exports.assertTSNullKeyword = assertTSNullKeyword; -exports.assertTSNeverKeyword = assertTSNeverKeyword; +exports.assertTSUnknownKeyword = assertTSUnknownKeyword; +exports.assertTSVoidKeyword = assertTSVoidKeyword; exports.assertTSThisType = assertTSThisType; exports.assertTSFunctionType = assertTSFunctionType; exports.assertTSConstructorType = assertTSConstructorType; @@ -197,6 +215,7 @@ exports.assertTSArrayType = assertTSArrayType; exports.assertTSTupleType = assertTSTupleType; exports.assertTSOptionalType = assertTSOptionalType; exports.assertTSRestType = assertTSRestType; +exports.assertTSNamedTupleMember = assertTSNamedTupleMember; exports.assertTSUnionType = assertTSUnionType; exports.assertTSIntersectionType = assertTSIntersectionType; exports.assertTSConditionalType = assertTSConditionalType; @@ -264,10 +283,13 @@ exports.assertFlowType = assertFlowType; exports.assertFlowBaseAnnotation = assertFlowBaseAnnotation; exports.assertFlowDeclaration = assertFlowDeclaration; exports.assertFlowPredicate = assertFlowPredicate; +exports.assertEnumBody = assertEnumBody; +exports.assertEnumMember = assertEnumMember; exports.assertJSX = assertJSX; exports.assertPrivate = assertPrivate; exports.assertTSTypeElement = assertTSTypeElement; exports.assertTSType = assertTSType; +exports.assertTSBaseType = assertTSBaseType; exports.assertNumberLiteral = assertNumberLiteral; exports.assertRegexLiteral = assertRegexLiteral; exports.assertRestProperty = assertRestProperty; @@ -279,7 +301,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function assert(type, node, opts) { if (!(0, _is.default)(type, node, opts)) { - throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, but instead got "${node.type}".`); + throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, ` + `but instead got "${node.type}".`); } } @@ -503,14 +525,14 @@ function assertClassBody(node, opts = {}) { assert("ClassBody", node, opts); } -function assertClassDeclaration(node, opts = {}) { - assert("ClassDeclaration", node, opts); -} - function assertClassExpression(node, opts = {}) { assert("ClassExpression", node, opts); } +function assertClassDeclaration(node, opts = {}) { + assert("ClassDeclaration", node, opts); +} + function assertExportAllDeclaration(node, opts = {}) { assert("ExportAllDeclaration", node, opts); } @@ -583,6 +605,30 @@ function assertYieldExpression(node, opts = {}) { assert("YieldExpression", node, opts); } +function assertAwaitExpression(node, opts = {}) { + assert("AwaitExpression", node, opts); +} + +function assertImport(node, opts = {}) { + assert("Import", node, opts); +} + +function assertBigIntLiteral(node, opts = {}) { + assert("BigIntLiteral", node, opts); +} + +function assertExportNamespaceSpecifier(node, opts = {}) { + assert("ExportNamespaceSpecifier", node, opts); +} + +function assertOptionalMemberExpression(node, opts = {}) { + assert("OptionalMemberExpression", node, opts); +} + +function assertOptionalCallExpression(node, opts = {}) { + assert("OptionalCallExpression", node, opts); +} + function assertAnyTypeAnnotation(node, opts = {}) { assert("AnyTypeAnnotation", node, opts); } @@ -747,6 +793,10 @@ function assertStringTypeAnnotation(node, opts = {}) { assert("StringTypeAnnotation", node, opts); } +function assertSymbolTypeAnnotation(node, opts = {}) { + assert("SymbolTypeAnnotation", node, opts); +} + function assertThisTypeAnnotation(node, opts = {}) { assert("ThisTypeAnnotation", node, opts); } @@ -795,6 +845,42 @@ function assertVoidTypeAnnotation(node, opts = {}) { assert("VoidTypeAnnotation", node, opts); } +function assertEnumDeclaration(node, opts = {}) { + assert("EnumDeclaration", node, opts); +} + +function assertEnumBooleanBody(node, opts = {}) { + assert("EnumBooleanBody", node, opts); +} + +function assertEnumNumberBody(node, opts = {}) { + assert("EnumNumberBody", node, opts); +} + +function assertEnumStringBody(node, opts = {}) { + assert("EnumStringBody", node, opts); +} + +function assertEnumSymbolBody(node, opts = {}) { + assert("EnumSymbolBody", node, opts); +} + +function assertEnumBooleanMember(node, opts = {}) { + assert("EnumBooleanMember", node, opts); +} + +function assertEnumNumberMember(node, opts = {}) { + assert("EnumNumberMember", node, opts); +} + +function assertEnumStringMember(node, opts = {}) { + assert("EnumStringMember", node, opts); +} + +function assertEnumDefaultedMember(node, opts = {}) { + assert("EnumDefaultedMember", node, opts); +} + function assertJSXAttribute(node, opts = {}) { assert("JSXAttribute", node, opts); } @@ -863,12 +949,12 @@ function assertPlaceholder(node, opts = {}) { assert("Placeholder", node, opts); } -function assertArgumentPlaceholder(node, opts = {}) { - assert("ArgumentPlaceholder", node, opts); +function assertV8IntrinsicIdentifier(node, opts = {}) { + assert("V8IntrinsicIdentifier", node, opts); } -function assertAwaitExpression(node, opts = {}) { - assert("AwaitExpression", node, opts); +function assertArgumentPlaceholder(node, opts = {}) { + assert("ArgumentPlaceholder", node, opts); } function assertBindExpression(node, opts = {}) { @@ -879,10 +965,6 @@ function assertClassProperty(node, opts = {}) { assert("ClassProperty", node, opts); } -function assertOptionalMemberExpression(node, opts = {}) { - assert("OptionalMemberExpression", node, opts); -} - function assertPipelineTopicExpression(node, opts = {}) { assert("PipelineTopicExpression", node, opts); } @@ -895,10 +977,6 @@ function assertPipelinePrimaryTopicReference(node, opts = {}) { assert("PipelinePrimaryTopicReference", node, opts); } -function assertOptionalCallExpression(node, opts = {}) { - assert("OptionalCallExpression", node, opts); -} - function assertClassPrivateProperty(node, opts = {}) { assert("ClassPrivateProperty", node, opts); } @@ -907,8 +985,8 @@ function assertClassPrivateMethod(node, opts = {}) { assert("ClassPrivateMethod", node, opts); } -function assertImport(node, opts = {}) { - assert("Import", node, opts); +function assertImportAttribute(node, opts = {}) { + assert("ImportAttribute", node, opts); } function assertDecorator(node, opts = {}) { @@ -923,16 +1001,24 @@ function assertExportDefaultSpecifier(node, opts = {}) { assert("ExportDefaultSpecifier", node, opts); } -function assertExportNamespaceSpecifier(node, opts = {}) { - assert("ExportNamespaceSpecifier", node, opts); -} - function assertPrivateName(node, opts = {}) { assert("PrivateName", node, opts); } -function assertBigIntLiteral(node, opts = {}) { - assert("BigIntLiteral", node, opts); +function assertRecordExpression(node, opts = {}) { + assert("RecordExpression", node, opts); +} + +function assertTupleExpression(node, opts = {}) { + assert("TupleExpression", node, opts); +} + +function assertDecimalLiteral(node, opts = {}) { + assert("DecimalLiteral", node, opts); +} + +function assertStaticBlock(node, opts = {}) { + assert("StaticBlock", node, opts); } function assertTSParameterProperty(node, opts = {}) { @@ -975,8 +1061,24 @@ function assertTSAnyKeyword(node, opts = {}) { assert("TSAnyKeyword", node, opts); } -function assertTSUnknownKeyword(node, opts = {}) { - assert("TSUnknownKeyword", node, opts); +function assertTSBooleanKeyword(node, opts = {}) { + assert("TSBooleanKeyword", node, opts); +} + +function assertTSBigIntKeyword(node, opts = {}) { + assert("TSBigIntKeyword", node, opts); +} + +function assertTSIntrinsicKeyword(node, opts = {}) { + assert("TSIntrinsicKeyword", node, opts); +} + +function assertTSNeverKeyword(node, opts = {}) { + assert("TSNeverKeyword", node, opts); +} + +function assertTSNullKeyword(node, opts = {}) { + assert("TSNullKeyword", node, opts); } function assertTSNumberKeyword(node, opts = {}) { @@ -987,10 +1089,6 @@ function assertTSObjectKeyword(node, opts = {}) { assert("TSObjectKeyword", node, opts); } -function assertTSBooleanKeyword(node, opts = {}) { - assert("TSBooleanKeyword", node, opts); -} - function assertTSStringKeyword(node, opts = {}) { assert("TSStringKeyword", node, opts); } @@ -999,20 +1097,16 @@ function assertTSSymbolKeyword(node, opts = {}) { assert("TSSymbolKeyword", node, opts); } -function assertTSVoidKeyword(node, opts = {}) { - assert("TSVoidKeyword", node, opts); -} - function assertTSUndefinedKeyword(node, opts = {}) { assert("TSUndefinedKeyword", node, opts); } -function assertTSNullKeyword(node, opts = {}) { - assert("TSNullKeyword", node, opts); +function assertTSUnknownKeyword(node, opts = {}) { + assert("TSUnknownKeyword", node, opts); } -function assertTSNeverKeyword(node, opts = {}) { - assert("TSNeverKeyword", node, opts); +function assertTSVoidKeyword(node, opts = {}) { + assert("TSVoidKeyword", node, opts); } function assertTSThisType(node, opts = {}) { @@ -1059,6 +1153,10 @@ function assertTSRestType(node, opts = {}) { assert("TSRestType", node, opts); } +function assertTSNamedTupleMember(node, opts = {}) { + assert("TSNamedTupleMember", node, opts); +} + function assertTSUnionType(node, opts = {}) { assert("TSUnionType", node, opts); } @@ -1327,6 +1425,14 @@ function assertFlowPredicate(node, opts = {}) { assert("FlowPredicate", node, opts); } +function assertEnumBody(node, opts = {}) { + assert("EnumBody", node, opts); +} + +function assertEnumMember(node, opts = {}) { + assert("EnumMember", node, opts); +} + function assertJSX(node, opts = {}) { assert("JSX", node, opts); } @@ -1343,6 +1449,10 @@ function assertTSType(node, opts = {}) { assert("TSType", node, opts); } +function assertTSBaseType(node, opts = {}) { + assert("TSBaseType", node, opts); +} + function assertNumberLiteral(node, opts) { console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); assert("NumberLiteral", node, opts); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/builder.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/builder.js similarity index 80% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/builder.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/builder.js index b42fac2f155f41..812cc17933069f 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/builder.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/builder.js @@ -5,15 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = builder; -function _clone() { - const data = _interopRequireDefault(require("lodash/clone")); - - _clone = function () { - return data; - }; - - return data; -} +var _clone = _interopRequireDefault(require("lodash/clone")); var _definitions = require("../definitions"); @@ -37,7 +29,7 @@ function builder(type, ...args) { const field = _definitions.NODE_FIELDS[type][key]; let arg; if (i < countArgs) arg = args[i]; - if (arg === undefined) arg = (0, _clone().default)(field.default); + if (arg === undefined) arg = (0, _clone.default)(field.default); node[key] = arg; i++; }); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js similarity index 85% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js index df76b0107ff09f..a91391ffdcfd78 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = createUnionTypeAnnotation; +exports.default = createFlowUnionType; var _generated = require("../generated"); @@ -11,7 +11,7 @@ var _removeTypeDuplicates = _interopRequireDefault(require("../../modifications/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function createUnionTypeAnnotation(types) { +function createFlowUnionType(types) { const flattened = (0, _removeTypeDuplicates.default)(types); if (flattened.length === 1) { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/generated/index.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/generated/index.js new file mode 100644 index 00000000000000..18152119ac791c --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/generated/index.js @@ -0,0 +1,1243 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ArrayExpression = exports.arrayExpression = arrayExpression; +exports.AssignmentExpression = exports.assignmentExpression = assignmentExpression; +exports.BinaryExpression = exports.binaryExpression = binaryExpression; +exports.InterpreterDirective = exports.interpreterDirective = interpreterDirective; +exports.Directive = exports.directive = directive; +exports.DirectiveLiteral = exports.directiveLiteral = directiveLiteral; +exports.BlockStatement = exports.blockStatement = blockStatement; +exports.BreakStatement = exports.breakStatement = breakStatement; +exports.CallExpression = exports.callExpression = callExpression; +exports.CatchClause = exports.catchClause = catchClause; +exports.ConditionalExpression = exports.conditionalExpression = conditionalExpression; +exports.ContinueStatement = exports.continueStatement = continueStatement; +exports.DebuggerStatement = exports.debuggerStatement = debuggerStatement; +exports.DoWhileStatement = exports.doWhileStatement = doWhileStatement; +exports.EmptyStatement = exports.emptyStatement = emptyStatement; +exports.ExpressionStatement = exports.expressionStatement = expressionStatement; +exports.File = exports.file = file; +exports.ForInStatement = exports.forInStatement = forInStatement; +exports.ForStatement = exports.forStatement = forStatement; +exports.FunctionDeclaration = exports.functionDeclaration = functionDeclaration; +exports.FunctionExpression = exports.functionExpression = functionExpression; +exports.Identifier = exports.identifier = identifier; +exports.IfStatement = exports.ifStatement = ifStatement; +exports.LabeledStatement = exports.labeledStatement = labeledStatement; +exports.StringLiteral = exports.stringLiteral = stringLiteral; +exports.NumericLiteral = exports.numericLiteral = numericLiteral; +exports.NullLiteral = exports.nullLiteral = nullLiteral; +exports.BooleanLiteral = exports.booleanLiteral = booleanLiteral; +exports.RegExpLiteral = exports.regExpLiteral = regExpLiteral; +exports.LogicalExpression = exports.logicalExpression = logicalExpression; +exports.MemberExpression = exports.memberExpression = memberExpression; +exports.NewExpression = exports.newExpression = newExpression; +exports.Program = exports.program = program; +exports.ObjectExpression = exports.objectExpression = objectExpression; +exports.ObjectMethod = exports.objectMethod = objectMethod; +exports.ObjectProperty = exports.objectProperty = objectProperty; +exports.RestElement = exports.restElement = restElement; +exports.ReturnStatement = exports.returnStatement = returnStatement; +exports.SequenceExpression = exports.sequenceExpression = sequenceExpression; +exports.ParenthesizedExpression = exports.parenthesizedExpression = parenthesizedExpression; +exports.SwitchCase = exports.switchCase = switchCase; +exports.SwitchStatement = exports.switchStatement = switchStatement; +exports.ThisExpression = exports.thisExpression = thisExpression; +exports.ThrowStatement = exports.throwStatement = throwStatement; +exports.TryStatement = exports.tryStatement = tryStatement; +exports.UnaryExpression = exports.unaryExpression = unaryExpression; +exports.UpdateExpression = exports.updateExpression = updateExpression; +exports.VariableDeclaration = exports.variableDeclaration = variableDeclaration; +exports.VariableDeclarator = exports.variableDeclarator = variableDeclarator; +exports.WhileStatement = exports.whileStatement = whileStatement; +exports.WithStatement = exports.withStatement = withStatement; +exports.AssignmentPattern = exports.assignmentPattern = assignmentPattern; +exports.ArrayPattern = exports.arrayPattern = arrayPattern; +exports.ArrowFunctionExpression = exports.arrowFunctionExpression = arrowFunctionExpression; +exports.ClassBody = exports.classBody = classBody; +exports.ClassExpression = exports.classExpression = classExpression; +exports.ClassDeclaration = exports.classDeclaration = classDeclaration; +exports.ExportAllDeclaration = exports.exportAllDeclaration = exportAllDeclaration; +exports.ExportDefaultDeclaration = exports.exportDefaultDeclaration = exportDefaultDeclaration; +exports.ExportNamedDeclaration = exports.exportNamedDeclaration = exportNamedDeclaration; +exports.ExportSpecifier = exports.exportSpecifier = exportSpecifier; +exports.ForOfStatement = exports.forOfStatement = forOfStatement; +exports.ImportDeclaration = exports.importDeclaration = importDeclaration; +exports.ImportDefaultSpecifier = exports.importDefaultSpecifier = importDefaultSpecifier; +exports.ImportNamespaceSpecifier = exports.importNamespaceSpecifier = importNamespaceSpecifier; +exports.ImportSpecifier = exports.importSpecifier = importSpecifier; +exports.MetaProperty = exports.metaProperty = metaProperty; +exports.ClassMethod = exports.classMethod = classMethod; +exports.ObjectPattern = exports.objectPattern = objectPattern; +exports.SpreadElement = exports.spreadElement = spreadElement; +exports.super = exports.Super = _super; +exports.TaggedTemplateExpression = exports.taggedTemplateExpression = taggedTemplateExpression; +exports.TemplateElement = exports.templateElement = templateElement; +exports.TemplateLiteral = exports.templateLiteral = templateLiteral; +exports.YieldExpression = exports.yieldExpression = yieldExpression; +exports.AwaitExpression = exports.awaitExpression = awaitExpression; +exports.import = exports.Import = _import; +exports.BigIntLiteral = exports.bigIntLiteral = bigIntLiteral; +exports.ExportNamespaceSpecifier = exports.exportNamespaceSpecifier = exportNamespaceSpecifier; +exports.OptionalMemberExpression = exports.optionalMemberExpression = optionalMemberExpression; +exports.OptionalCallExpression = exports.optionalCallExpression = optionalCallExpression; +exports.AnyTypeAnnotation = exports.anyTypeAnnotation = anyTypeAnnotation; +exports.ArrayTypeAnnotation = exports.arrayTypeAnnotation = arrayTypeAnnotation; +exports.BooleanTypeAnnotation = exports.booleanTypeAnnotation = booleanTypeAnnotation; +exports.BooleanLiteralTypeAnnotation = exports.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation; +exports.NullLiteralTypeAnnotation = exports.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation; +exports.ClassImplements = exports.classImplements = classImplements; +exports.DeclareClass = exports.declareClass = declareClass; +exports.DeclareFunction = exports.declareFunction = declareFunction; +exports.DeclareInterface = exports.declareInterface = declareInterface; +exports.DeclareModule = exports.declareModule = declareModule; +exports.DeclareModuleExports = exports.declareModuleExports = declareModuleExports; +exports.DeclareTypeAlias = exports.declareTypeAlias = declareTypeAlias; +exports.DeclareOpaqueType = exports.declareOpaqueType = declareOpaqueType; +exports.DeclareVariable = exports.declareVariable = declareVariable; +exports.DeclareExportDeclaration = exports.declareExportDeclaration = declareExportDeclaration; +exports.DeclareExportAllDeclaration = exports.declareExportAllDeclaration = declareExportAllDeclaration; +exports.DeclaredPredicate = exports.declaredPredicate = declaredPredicate; +exports.ExistsTypeAnnotation = exports.existsTypeAnnotation = existsTypeAnnotation; +exports.FunctionTypeAnnotation = exports.functionTypeAnnotation = functionTypeAnnotation; +exports.FunctionTypeParam = exports.functionTypeParam = functionTypeParam; +exports.GenericTypeAnnotation = exports.genericTypeAnnotation = genericTypeAnnotation; +exports.InferredPredicate = exports.inferredPredicate = inferredPredicate; +exports.InterfaceExtends = exports.interfaceExtends = interfaceExtends; +exports.InterfaceDeclaration = exports.interfaceDeclaration = interfaceDeclaration; +exports.InterfaceTypeAnnotation = exports.interfaceTypeAnnotation = interfaceTypeAnnotation; +exports.IntersectionTypeAnnotation = exports.intersectionTypeAnnotation = intersectionTypeAnnotation; +exports.MixedTypeAnnotation = exports.mixedTypeAnnotation = mixedTypeAnnotation; +exports.EmptyTypeAnnotation = exports.emptyTypeAnnotation = emptyTypeAnnotation; +exports.NullableTypeAnnotation = exports.nullableTypeAnnotation = nullableTypeAnnotation; +exports.NumberLiteralTypeAnnotation = exports.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation; +exports.NumberTypeAnnotation = exports.numberTypeAnnotation = numberTypeAnnotation; +exports.ObjectTypeAnnotation = exports.objectTypeAnnotation = objectTypeAnnotation; +exports.ObjectTypeInternalSlot = exports.objectTypeInternalSlot = objectTypeInternalSlot; +exports.ObjectTypeCallProperty = exports.objectTypeCallProperty = objectTypeCallProperty; +exports.ObjectTypeIndexer = exports.objectTypeIndexer = objectTypeIndexer; +exports.ObjectTypeProperty = exports.objectTypeProperty = objectTypeProperty; +exports.ObjectTypeSpreadProperty = exports.objectTypeSpreadProperty = objectTypeSpreadProperty; +exports.OpaqueType = exports.opaqueType = opaqueType; +exports.QualifiedTypeIdentifier = exports.qualifiedTypeIdentifier = qualifiedTypeIdentifier; +exports.StringLiteralTypeAnnotation = exports.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation; +exports.StringTypeAnnotation = exports.stringTypeAnnotation = stringTypeAnnotation; +exports.SymbolTypeAnnotation = exports.symbolTypeAnnotation = symbolTypeAnnotation; +exports.ThisTypeAnnotation = exports.thisTypeAnnotation = thisTypeAnnotation; +exports.TupleTypeAnnotation = exports.tupleTypeAnnotation = tupleTypeAnnotation; +exports.TypeofTypeAnnotation = exports.typeofTypeAnnotation = typeofTypeAnnotation; +exports.TypeAlias = exports.typeAlias = typeAlias; +exports.TypeAnnotation = exports.typeAnnotation = typeAnnotation; +exports.TypeCastExpression = exports.typeCastExpression = typeCastExpression; +exports.TypeParameter = exports.typeParameter = typeParameter; +exports.TypeParameterDeclaration = exports.typeParameterDeclaration = typeParameterDeclaration; +exports.TypeParameterInstantiation = exports.typeParameterInstantiation = typeParameterInstantiation; +exports.UnionTypeAnnotation = exports.unionTypeAnnotation = unionTypeAnnotation; +exports.Variance = exports.variance = variance; +exports.VoidTypeAnnotation = exports.voidTypeAnnotation = voidTypeAnnotation; +exports.EnumDeclaration = exports.enumDeclaration = enumDeclaration; +exports.EnumBooleanBody = exports.enumBooleanBody = enumBooleanBody; +exports.EnumNumberBody = exports.enumNumberBody = enumNumberBody; +exports.EnumStringBody = exports.enumStringBody = enumStringBody; +exports.EnumSymbolBody = exports.enumSymbolBody = enumSymbolBody; +exports.EnumBooleanMember = exports.enumBooleanMember = enumBooleanMember; +exports.EnumNumberMember = exports.enumNumberMember = enumNumberMember; +exports.EnumStringMember = exports.enumStringMember = enumStringMember; +exports.EnumDefaultedMember = exports.enumDefaultedMember = enumDefaultedMember; +exports.jSXAttribute = exports.JSXAttribute = exports.jsxAttribute = jsxAttribute; +exports.jSXClosingElement = exports.JSXClosingElement = exports.jsxClosingElement = jsxClosingElement; +exports.jSXElement = exports.JSXElement = exports.jsxElement = jsxElement; +exports.jSXEmptyExpression = exports.JSXEmptyExpression = exports.jsxEmptyExpression = jsxEmptyExpression; +exports.jSXExpressionContainer = exports.JSXExpressionContainer = exports.jsxExpressionContainer = jsxExpressionContainer; +exports.jSXSpreadChild = exports.JSXSpreadChild = exports.jsxSpreadChild = jsxSpreadChild; +exports.jSXIdentifier = exports.JSXIdentifier = exports.jsxIdentifier = jsxIdentifier; +exports.jSXMemberExpression = exports.JSXMemberExpression = exports.jsxMemberExpression = jsxMemberExpression; +exports.jSXNamespacedName = exports.JSXNamespacedName = exports.jsxNamespacedName = jsxNamespacedName; +exports.jSXOpeningElement = exports.JSXOpeningElement = exports.jsxOpeningElement = jsxOpeningElement; +exports.jSXSpreadAttribute = exports.JSXSpreadAttribute = exports.jsxSpreadAttribute = jsxSpreadAttribute; +exports.jSXText = exports.JSXText = exports.jsxText = jsxText; +exports.jSXFragment = exports.JSXFragment = exports.jsxFragment = jsxFragment; +exports.jSXOpeningFragment = exports.JSXOpeningFragment = exports.jsxOpeningFragment = jsxOpeningFragment; +exports.jSXClosingFragment = exports.JSXClosingFragment = exports.jsxClosingFragment = jsxClosingFragment; +exports.Noop = exports.noop = noop; +exports.Placeholder = exports.placeholder = placeholder; +exports.V8IntrinsicIdentifier = exports.v8IntrinsicIdentifier = v8IntrinsicIdentifier; +exports.ArgumentPlaceholder = exports.argumentPlaceholder = argumentPlaceholder; +exports.BindExpression = exports.bindExpression = bindExpression; +exports.ClassProperty = exports.classProperty = classProperty; +exports.PipelineTopicExpression = exports.pipelineTopicExpression = pipelineTopicExpression; +exports.PipelineBareFunction = exports.pipelineBareFunction = pipelineBareFunction; +exports.PipelinePrimaryTopicReference = exports.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference; +exports.ClassPrivateProperty = exports.classPrivateProperty = classPrivateProperty; +exports.ClassPrivateMethod = exports.classPrivateMethod = classPrivateMethod; +exports.ImportAttribute = exports.importAttribute = importAttribute; +exports.Decorator = exports.decorator = decorator; +exports.DoExpression = exports.doExpression = doExpression; +exports.ExportDefaultSpecifier = exports.exportDefaultSpecifier = exportDefaultSpecifier; +exports.PrivateName = exports.privateName = privateName; +exports.RecordExpression = exports.recordExpression = recordExpression; +exports.TupleExpression = exports.tupleExpression = tupleExpression; +exports.DecimalLiteral = exports.decimalLiteral = decimalLiteral; +exports.StaticBlock = exports.staticBlock = staticBlock; +exports.tSParameterProperty = exports.TSParameterProperty = exports.tsParameterProperty = tsParameterProperty; +exports.tSDeclareFunction = exports.TSDeclareFunction = exports.tsDeclareFunction = tsDeclareFunction; +exports.tSDeclareMethod = exports.TSDeclareMethod = exports.tsDeclareMethod = tsDeclareMethod; +exports.tSQualifiedName = exports.TSQualifiedName = exports.tsQualifiedName = tsQualifiedName; +exports.tSCallSignatureDeclaration = exports.TSCallSignatureDeclaration = exports.tsCallSignatureDeclaration = tsCallSignatureDeclaration; +exports.tSConstructSignatureDeclaration = exports.TSConstructSignatureDeclaration = exports.tsConstructSignatureDeclaration = tsConstructSignatureDeclaration; +exports.tSPropertySignature = exports.TSPropertySignature = exports.tsPropertySignature = tsPropertySignature; +exports.tSMethodSignature = exports.TSMethodSignature = exports.tsMethodSignature = tsMethodSignature; +exports.tSIndexSignature = exports.TSIndexSignature = exports.tsIndexSignature = tsIndexSignature; +exports.tSAnyKeyword = exports.TSAnyKeyword = exports.tsAnyKeyword = tsAnyKeyword; +exports.tSBooleanKeyword = exports.TSBooleanKeyword = exports.tsBooleanKeyword = tsBooleanKeyword; +exports.tSBigIntKeyword = exports.TSBigIntKeyword = exports.tsBigIntKeyword = tsBigIntKeyword; +exports.tSIntrinsicKeyword = exports.TSIntrinsicKeyword = exports.tsIntrinsicKeyword = tsIntrinsicKeyword; +exports.tSNeverKeyword = exports.TSNeverKeyword = exports.tsNeverKeyword = tsNeverKeyword; +exports.tSNullKeyword = exports.TSNullKeyword = exports.tsNullKeyword = tsNullKeyword; +exports.tSNumberKeyword = exports.TSNumberKeyword = exports.tsNumberKeyword = tsNumberKeyword; +exports.tSObjectKeyword = exports.TSObjectKeyword = exports.tsObjectKeyword = tsObjectKeyword; +exports.tSStringKeyword = exports.TSStringKeyword = exports.tsStringKeyword = tsStringKeyword; +exports.tSSymbolKeyword = exports.TSSymbolKeyword = exports.tsSymbolKeyword = tsSymbolKeyword; +exports.tSUndefinedKeyword = exports.TSUndefinedKeyword = exports.tsUndefinedKeyword = tsUndefinedKeyword; +exports.tSUnknownKeyword = exports.TSUnknownKeyword = exports.tsUnknownKeyword = tsUnknownKeyword; +exports.tSVoidKeyword = exports.TSVoidKeyword = exports.tsVoidKeyword = tsVoidKeyword; +exports.tSThisType = exports.TSThisType = exports.tsThisType = tsThisType; +exports.tSFunctionType = exports.TSFunctionType = exports.tsFunctionType = tsFunctionType; +exports.tSConstructorType = exports.TSConstructorType = exports.tsConstructorType = tsConstructorType; +exports.tSTypeReference = exports.TSTypeReference = exports.tsTypeReference = tsTypeReference; +exports.tSTypePredicate = exports.TSTypePredicate = exports.tsTypePredicate = tsTypePredicate; +exports.tSTypeQuery = exports.TSTypeQuery = exports.tsTypeQuery = tsTypeQuery; +exports.tSTypeLiteral = exports.TSTypeLiteral = exports.tsTypeLiteral = tsTypeLiteral; +exports.tSArrayType = exports.TSArrayType = exports.tsArrayType = tsArrayType; +exports.tSTupleType = exports.TSTupleType = exports.tsTupleType = tsTupleType; +exports.tSOptionalType = exports.TSOptionalType = exports.tsOptionalType = tsOptionalType; +exports.tSRestType = exports.TSRestType = exports.tsRestType = tsRestType; +exports.tSNamedTupleMember = exports.TSNamedTupleMember = exports.tsNamedTupleMember = tsNamedTupleMember; +exports.tSUnionType = exports.TSUnionType = exports.tsUnionType = tsUnionType; +exports.tSIntersectionType = exports.TSIntersectionType = exports.tsIntersectionType = tsIntersectionType; +exports.tSConditionalType = exports.TSConditionalType = exports.tsConditionalType = tsConditionalType; +exports.tSInferType = exports.TSInferType = exports.tsInferType = tsInferType; +exports.tSParenthesizedType = exports.TSParenthesizedType = exports.tsParenthesizedType = tsParenthesizedType; +exports.tSTypeOperator = exports.TSTypeOperator = exports.tsTypeOperator = tsTypeOperator; +exports.tSIndexedAccessType = exports.TSIndexedAccessType = exports.tsIndexedAccessType = tsIndexedAccessType; +exports.tSMappedType = exports.TSMappedType = exports.tsMappedType = tsMappedType; +exports.tSLiteralType = exports.TSLiteralType = exports.tsLiteralType = tsLiteralType; +exports.tSExpressionWithTypeArguments = exports.TSExpressionWithTypeArguments = exports.tsExpressionWithTypeArguments = tsExpressionWithTypeArguments; +exports.tSInterfaceDeclaration = exports.TSInterfaceDeclaration = exports.tsInterfaceDeclaration = tsInterfaceDeclaration; +exports.tSInterfaceBody = exports.TSInterfaceBody = exports.tsInterfaceBody = tsInterfaceBody; +exports.tSTypeAliasDeclaration = exports.TSTypeAliasDeclaration = exports.tsTypeAliasDeclaration = tsTypeAliasDeclaration; +exports.tSAsExpression = exports.TSAsExpression = exports.tsAsExpression = tsAsExpression; +exports.tSTypeAssertion = exports.TSTypeAssertion = exports.tsTypeAssertion = tsTypeAssertion; +exports.tSEnumDeclaration = exports.TSEnumDeclaration = exports.tsEnumDeclaration = tsEnumDeclaration; +exports.tSEnumMember = exports.TSEnumMember = exports.tsEnumMember = tsEnumMember; +exports.tSModuleDeclaration = exports.TSModuleDeclaration = exports.tsModuleDeclaration = tsModuleDeclaration; +exports.tSModuleBlock = exports.TSModuleBlock = exports.tsModuleBlock = tsModuleBlock; +exports.tSImportType = exports.TSImportType = exports.tsImportType = tsImportType; +exports.tSImportEqualsDeclaration = exports.TSImportEqualsDeclaration = exports.tsImportEqualsDeclaration = tsImportEqualsDeclaration; +exports.tSExternalModuleReference = exports.TSExternalModuleReference = exports.tsExternalModuleReference = tsExternalModuleReference; +exports.tSNonNullExpression = exports.TSNonNullExpression = exports.tsNonNullExpression = tsNonNullExpression; +exports.tSExportAssignment = exports.TSExportAssignment = exports.tsExportAssignment = tsExportAssignment; +exports.tSNamespaceExportDeclaration = exports.TSNamespaceExportDeclaration = exports.tsNamespaceExportDeclaration = tsNamespaceExportDeclaration; +exports.tSTypeAnnotation = exports.TSTypeAnnotation = exports.tsTypeAnnotation = tsTypeAnnotation; +exports.tSTypeParameterInstantiation = exports.TSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = tsTypeParameterInstantiation; +exports.tSTypeParameterDeclaration = exports.TSTypeParameterDeclaration = exports.tsTypeParameterDeclaration = tsTypeParameterDeclaration; +exports.tSTypeParameter = exports.TSTypeParameter = exports.tsTypeParameter = tsTypeParameter; +exports.numberLiteral = exports.NumberLiteral = NumberLiteral; +exports.regexLiteral = exports.RegexLiteral = RegexLiteral; +exports.restProperty = exports.RestProperty = RestProperty; +exports.spreadProperty = exports.SpreadProperty = SpreadProperty; + +var _builder = _interopRequireDefault(require("../builder")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function arrayExpression(...args) { + return (0, _builder.default)("ArrayExpression", ...args); +} + +function assignmentExpression(...args) { + return (0, _builder.default)("AssignmentExpression", ...args); +} + +function binaryExpression(...args) { + return (0, _builder.default)("BinaryExpression", ...args); +} + +function interpreterDirective(...args) { + return (0, _builder.default)("InterpreterDirective", ...args); +} + +function directive(...args) { + return (0, _builder.default)("Directive", ...args); +} + +function directiveLiteral(...args) { + return (0, _builder.default)("DirectiveLiteral", ...args); +} + +function blockStatement(...args) { + return (0, _builder.default)("BlockStatement", ...args); +} + +function breakStatement(...args) { + return (0, _builder.default)("BreakStatement", ...args); +} + +function callExpression(...args) { + return (0, _builder.default)("CallExpression", ...args); +} + +function catchClause(...args) { + return (0, _builder.default)("CatchClause", ...args); +} + +function conditionalExpression(...args) { + return (0, _builder.default)("ConditionalExpression", ...args); +} + +function continueStatement(...args) { + return (0, _builder.default)("ContinueStatement", ...args); +} + +function debuggerStatement(...args) { + return (0, _builder.default)("DebuggerStatement", ...args); +} + +function doWhileStatement(...args) { + return (0, _builder.default)("DoWhileStatement", ...args); +} + +function emptyStatement(...args) { + return (0, _builder.default)("EmptyStatement", ...args); +} + +function expressionStatement(...args) { + return (0, _builder.default)("ExpressionStatement", ...args); +} + +function file(...args) { + return (0, _builder.default)("File", ...args); +} + +function forInStatement(...args) { + return (0, _builder.default)("ForInStatement", ...args); +} + +function forStatement(...args) { + return (0, _builder.default)("ForStatement", ...args); +} + +function functionDeclaration(...args) { + return (0, _builder.default)("FunctionDeclaration", ...args); +} + +function functionExpression(...args) { + return (0, _builder.default)("FunctionExpression", ...args); +} + +function identifier(...args) { + return (0, _builder.default)("Identifier", ...args); +} + +function ifStatement(...args) { + return (0, _builder.default)("IfStatement", ...args); +} + +function labeledStatement(...args) { + return (0, _builder.default)("LabeledStatement", ...args); +} + +function stringLiteral(...args) { + return (0, _builder.default)("StringLiteral", ...args); +} + +function numericLiteral(...args) { + return (0, _builder.default)("NumericLiteral", ...args); +} + +function nullLiteral(...args) { + return (0, _builder.default)("NullLiteral", ...args); +} + +function booleanLiteral(...args) { + return (0, _builder.default)("BooleanLiteral", ...args); +} + +function regExpLiteral(...args) { + return (0, _builder.default)("RegExpLiteral", ...args); +} + +function logicalExpression(...args) { + return (0, _builder.default)("LogicalExpression", ...args); +} + +function memberExpression(...args) { + return (0, _builder.default)("MemberExpression", ...args); +} + +function newExpression(...args) { + return (0, _builder.default)("NewExpression", ...args); +} + +function program(...args) { + return (0, _builder.default)("Program", ...args); +} + +function objectExpression(...args) { + return (0, _builder.default)("ObjectExpression", ...args); +} + +function objectMethod(...args) { + return (0, _builder.default)("ObjectMethod", ...args); +} + +function objectProperty(...args) { + return (0, _builder.default)("ObjectProperty", ...args); +} + +function restElement(...args) { + return (0, _builder.default)("RestElement", ...args); +} + +function returnStatement(...args) { + return (0, _builder.default)("ReturnStatement", ...args); +} + +function sequenceExpression(...args) { + return (0, _builder.default)("SequenceExpression", ...args); +} + +function parenthesizedExpression(...args) { + return (0, _builder.default)("ParenthesizedExpression", ...args); +} + +function switchCase(...args) { + return (0, _builder.default)("SwitchCase", ...args); +} + +function switchStatement(...args) { + return (0, _builder.default)("SwitchStatement", ...args); +} + +function thisExpression(...args) { + return (0, _builder.default)("ThisExpression", ...args); +} + +function throwStatement(...args) { + return (0, _builder.default)("ThrowStatement", ...args); +} + +function tryStatement(...args) { + return (0, _builder.default)("TryStatement", ...args); +} + +function unaryExpression(...args) { + return (0, _builder.default)("UnaryExpression", ...args); +} + +function updateExpression(...args) { + return (0, _builder.default)("UpdateExpression", ...args); +} + +function variableDeclaration(...args) { + return (0, _builder.default)("VariableDeclaration", ...args); +} + +function variableDeclarator(...args) { + return (0, _builder.default)("VariableDeclarator", ...args); +} + +function whileStatement(...args) { + return (0, _builder.default)("WhileStatement", ...args); +} + +function withStatement(...args) { + return (0, _builder.default)("WithStatement", ...args); +} + +function assignmentPattern(...args) { + return (0, _builder.default)("AssignmentPattern", ...args); +} + +function arrayPattern(...args) { + return (0, _builder.default)("ArrayPattern", ...args); +} + +function arrowFunctionExpression(...args) { + return (0, _builder.default)("ArrowFunctionExpression", ...args); +} + +function classBody(...args) { + return (0, _builder.default)("ClassBody", ...args); +} + +function classExpression(...args) { + return (0, _builder.default)("ClassExpression", ...args); +} + +function classDeclaration(...args) { + return (0, _builder.default)("ClassDeclaration", ...args); +} + +function exportAllDeclaration(...args) { + return (0, _builder.default)("ExportAllDeclaration", ...args); +} + +function exportDefaultDeclaration(...args) { + return (0, _builder.default)("ExportDefaultDeclaration", ...args); +} + +function exportNamedDeclaration(...args) { + return (0, _builder.default)("ExportNamedDeclaration", ...args); +} + +function exportSpecifier(...args) { + return (0, _builder.default)("ExportSpecifier", ...args); +} + +function forOfStatement(...args) { + return (0, _builder.default)("ForOfStatement", ...args); +} + +function importDeclaration(...args) { + return (0, _builder.default)("ImportDeclaration", ...args); +} + +function importDefaultSpecifier(...args) { + return (0, _builder.default)("ImportDefaultSpecifier", ...args); +} + +function importNamespaceSpecifier(...args) { + return (0, _builder.default)("ImportNamespaceSpecifier", ...args); +} + +function importSpecifier(...args) { + return (0, _builder.default)("ImportSpecifier", ...args); +} + +function metaProperty(...args) { + return (0, _builder.default)("MetaProperty", ...args); +} + +function classMethod(...args) { + return (0, _builder.default)("ClassMethod", ...args); +} + +function objectPattern(...args) { + return (0, _builder.default)("ObjectPattern", ...args); +} + +function spreadElement(...args) { + return (0, _builder.default)("SpreadElement", ...args); +} + +function _super(...args) { + return (0, _builder.default)("Super", ...args); +} + +function taggedTemplateExpression(...args) { + return (0, _builder.default)("TaggedTemplateExpression", ...args); +} + +function templateElement(...args) { + return (0, _builder.default)("TemplateElement", ...args); +} + +function templateLiteral(...args) { + return (0, _builder.default)("TemplateLiteral", ...args); +} + +function yieldExpression(...args) { + return (0, _builder.default)("YieldExpression", ...args); +} + +function awaitExpression(...args) { + return (0, _builder.default)("AwaitExpression", ...args); +} + +function _import(...args) { + return (0, _builder.default)("Import", ...args); +} + +function bigIntLiteral(...args) { + return (0, _builder.default)("BigIntLiteral", ...args); +} + +function exportNamespaceSpecifier(...args) { + return (0, _builder.default)("ExportNamespaceSpecifier", ...args); +} + +function optionalMemberExpression(...args) { + return (0, _builder.default)("OptionalMemberExpression", ...args); +} + +function optionalCallExpression(...args) { + return (0, _builder.default)("OptionalCallExpression", ...args); +} + +function anyTypeAnnotation(...args) { + return (0, _builder.default)("AnyTypeAnnotation", ...args); +} + +function arrayTypeAnnotation(...args) { + return (0, _builder.default)("ArrayTypeAnnotation", ...args); +} + +function booleanTypeAnnotation(...args) { + return (0, _builder.default)("BooleanTypeAnnotation", ...args); +} + +function booleanLiteralTypeAnnotation(...args) { + return (0, _builder.default)("BooleanLiteralTypeAnnotation", ...args); +} + +function nullLiteralTypeAnnotation(...args) { + return (0, _builder.default)("NullLiteralTypeAnnotation", ...args); +} + +function classImplements(...args) { + return (0, _builder.default)("ClassImplements", ...args); +} + +function declareClass(...args) { + return (0, _builder.default)("DeclareClass", ...args); +} + +function declareFunction(...args) { + return (0, _builder.default)("DeclareFunction", ...args); +} + +function declareInterface(...args) { + return (0, _builder.default)("DeclareInterface", ...args); +} + +function declareModule(...args) { + return (0, _builder.default)("DeclareModule", ...args); +} + +function declareModuleExports(...args) { + return (0, _builder.default)("DeclareModuleExports", ...args); +} + +function declareTypeAlias(...args) { + return (0, _builder.default)("DeclareTypeAlias", ...args); +} + +function declareOpaqueType(...args) { + return (0, _builder.default)("DeclareOpaqueType", ...args); +} + +function declareVariable(...args) { + return (0, _builder.default)("DeclareVariable", ...args); +} + +function declareExportDeclaration(...args) { + return (0, _builder.default)("DeclareExportDeclaration", ...args); +} + +function declareExportAllDeclaration(...args) { + return (0, _builder.default)("DeclareExportAllDeclaration", ...args); +} + +function declaredPredicate(...args) { + return (0, _builder.default)("DeclaredPredicate", ...args); +} + +function existsTypeAnnotation(...args) { + return (0, _builder.default)("ExistsTypeAnnotation", ...args); +} + +function functionTypeAnnotation(...args) { + return (0, _builder.default)("FunctionTypeAnnotation", ...args); +} + +function functionTypeParam(...args) { + return (0, _builder.default)("FunctionTypeParam", ...args); +} + +function genericTypeAnnotation(...args) { + return (0, _builder.default)("GenericTypeAnnotation", ...args); +} + +function inferredPredicate(...args) { + return (0, _builder.default)("InferredPredicate", ...args); +} + +function interfaceExtends(...args) { + return (0, _builder.default)("InterfaceExtends", ...args); +} + +function interfaceDeclaration(...args) { + return (0, _builder.default)("InterfaceDeclaration", ...args); +} + +function interfaceTypeAnnotation(...args) { + return (0, _builder.default)("InterfaceTypeAnnotation", ...args); +} + +function intersectionTypeAnnotation(...args) { + return (0, _builder.default)("IntersectionTypeAnnotation", ...args); +} + +function mixedTypeAnnotation(...args) { + return (0, _builder.default)("MixedTypeAnnotation", ...args); +} + +function emptyTypeAnnotation(...args) { + return (0, _builder.default)("EmptyTypeAnnotation", ...args); +} + +function nullableTypeAnnotation(...args) { + return (0, _builder.default)("NullableTypeAnnotation", ...args); +} + +function numberLiteralTypeAnnotation(...args) { + return (0, _builder.default)("NumberLiteralTypeAnnotation", ...args); +} + +function numberTypeAnnotation(...args) { + return (0, _builder.default)("NumberTypeAnnotation", ...args); +} + +function objectTypeAnnotation(...args) { + return (0, _builder.default)("ObjectTypeAnnotation", ...args); +} + +function objectTypeInternalSlot(...args) { + return (0, _builder.default)("ObjectTypeInternalSlot", ...args); +} + +function objectTypeCallProperty(...args) { + return (0, _builder.default)("ObjectTypeCallProperty", ...args); +} + +function objectTypeIndexer(...args) { + return (0, _builder.default)("ObjectTypeIndexer", ...args); +} + +function objectTypeProperty(...args) { + return (0, _builder.default)("ObjectTypeProperty", ...args); +} + +function objectTypeSpreadProperty(...args) { + return (0, _builder.default)("ObjectTypeSpreadProperty", ...args); +} + +function opaqueType(...args) { + return (0, _builder.default)("OpaqueType", ...args); +} + +function qualifiedTypeIdentifier(...args) { + return (0, _builder.default)("QualifiedTypeIdentifier", ...args); +} + +function stringLiteralTypeAnnotation(...args) { + return (0, _builder.default)("StringLiteralTypeAnnotation", ...args); +} + +function stringTypeAnnotation(...args) { + return (0, _builder.default)("StringTypeAnnotation", ...args); +} + +function symbolTypeAnnotation(...args) { + return (0, _builder.default)("SymbolTypeAnnotation", ...args); +} + +function thisTypeAnnotation(...args) { + return (0, _builder.default)("ThisTypeAnnotation", ...args); +} + +function tupleTypeAnnotation(...args) { + return (0, _builder.default)("TupleTypeAnnotation", ...args); +} + +function typeofTypeAnnotation(...args) { + return (0, _builder.default)("TypeofTypeAnnotation", ...args); +} + +function typeAlias(...args) { + return (0, _builder.default)("TypeAlias", ...args); +} + +function typeAnnotation(...args) { + return (0, _builder.default)("TypeAnnotation", ...args); +} + +function typeCastExpression(...args) { + return (0, _builder.default)("TypeCastExpression", ...args); +} + +function typeParameter(...args) { + return (0, _builder.default)("TypeParameter", ...args); +} + +function typeParameterDeclaration(...args) { + return (0, _builder.default)("TypeParameterDeclaration", ...args); +} + +function typeParameterInstantiation(...args) { + return (0, _builder.default)("TypeParameterInstantiation", ...args); +} + +function unionTypeAnnotation(...args) { + return (0, _builder.default)("UnionTypeAnnotation", ...args); +} + +function variance(...args) { + return (0, _builder.default)("Variance", ...args); +} + +function voidTypeAnnotation(...args) { + return (0, _builder.default)("VoidTypeAnnotation", ...args); +} + +function enumDeclaration(...args) { + return (0, _builder.default)("EnumDeclaration", ...args); +} + +function enumBooleanBody(...args) { + return (0, _builder.default)("EnumBooleanBody", ...args); +} + +function enumNumberBody(...args) { + return (0, _builder.default)("EnumNumberBody", ...args); +} + +function enumStringBody(...args) { + return (0, _builder.default)("EnumStringBody", ...args); +} + +function enumSymbolBody(...args) { + return (0, _builder.default)("EnumSymbolBody", ...args); +} + +function enumBooleanMember(...args) { + return (0, _builder.default)("EnumBooleanMember", ...args); +} + +function enumNumberMember(...args) { + return (0, _builder.default)("EnumNumberMember", ...args); +} + +function enumStringMember(...args) { + return (0, _builder.default)("EnumStringMember", ...args); +} + +function enumDefaultedMember(...args) { + return (0, _builder.default)("EnumDefaultedMember", ...args); +} + +function jsxAttribute(...args) { + return (0, _builder.default)("JSXAttribute", ...args); +} + +function jsxClosingElement(...args) { + return (0, _builder.default)("JSXClosingElement", ...args); +} + +function jsxElement(...args) { + return (0, _builder.default)("JSXElement", ...args); +} + +function jsxEmptyExpression(...args) { + return (0, _builder.default)("JSXEmptyExpression", ...args); +} + +function jsxExpressionContainer(...args) { + return (0, _builder.default)("JSXExpressionContainer", ...args); +} + +function jsxSpreadChild(...args) { + return (0, _builder.default)("JSXSpreadChild", ...args); +} + +function jsxIdentifier(...args) { + return (0, _builder.default)("JSXIdentifier", ...args); +} + +function jsxMemberExpression(...args) { + return (0, _builder.default)("JSXMemberExpression", ...args); +} + +function jsxNamespacedName(...args) { + return (0, _builder.default)("JSXNamespacedName", ...args); +} + +function jsxOpeningElement(...args) { + return (0, _builder.default)("JSXOpeningElement", ...args); +} + +function jsxSpreadAttribute(...args) { + return (0, _builder.default)("JSXSpreadAttribute", ...args); +} + +function jsxText(...args) { + return (0, _builder.default)("JSXText", ...args); +} + +function jsxFragment(...args) { + return (0, _builder.default)("JSXFragment", ...args); +} + +function jsxOpeningFragment(...args) { + return (0, _builder.default)("JSXOpeningFragment", ...args); +} + +function jsxClosingFragment(...args) { + return (0, _builder.default)("JSXClosingFragment", ...args); +} + +function noop(...args) { + return (0, _builder.default)("Noop", ...args); +} + +function placeholder(...args) { + return (0, _builder.default)("Placeholder", ...args); +} + +function v8IntrinsicIdentifier(...args) { + return (0, _builder.default)("V8IntrinsicIdentifier", ...args); +} + +function argumentPlaceholder(...args) { + return (0, _builder.default)("ArgumentPlaceholder", ...args); +} + +function bindExpression(...args) { + return (0, _builder.default)("BindExpression", ...args); +} + +function classProperty(...args) { + return (0, _builder.default)("ClassProperty", ...args); +} + +function pipelineTopicExpression(...args) { + return (0, _builder.default)("PipelineTopicExpression", ...args); +} + +function pipelineBareFunction(...args) { + return (0, _builder.default)("PipelineBareFunction", ...args); +} + +function pipelinePrimaryTopicReference(...args) { + return (0, _builder.default)("PipelinePrimaryTopicReference", ...args); +} + +function classPrivateProperty(...args) { + return (0, _builder.default)("ClassPrivateProperty", ...args); +} + +function classPrivateMethod(...args) { + return (0, _builder.default)("ClassPrivateMethod", ...args); +} + +function importAttribute(...args) { + return (0, _builder.default)("ImportAttribute", ...args); +} + +function decorator(...args) { + return (0, _builder.default)("Decorator", ...args); +} + +function doExpression(...args) { + return (0, _builder.default)("DoExpression", ...args); +} + +function exportDefaultSpecifier(...args) { + return (0, _builder.default)("ExportDefaultSpecifier", ...args); +} + +function privateName(...args) { + return (0, _builder.default)("PrivateName", ...args); +} + +function recordExpression(...args) { + return (0, _builder.default)("RecordExpression", ...args); +} + +function tupleExpression(...args) { + return (0, _builder.default)("TupleExpression", ...args); +} + +function decimalLiteral(...args) { + return (0, _builder.default)("DecimalLiteral", ...args); +} + +function staticBlock(...args) { + return (0, _builder.default)("StaticBlock", ...args); +} + +function tsParameterProperty(...args) { + return (0, _builder.default)("TSParameterProperty", ...args); +} + +function tsDeclareFunction(...args) { + return (0, _builder.default)("TSDeclareFunction", ...args); +} + +function tsDeclareMethod(...args) { + return (0, _builder.default)("TSDeclareMethod", ...args); +} + +function tsQualifiedName(...args) { + return (0, _builder.default)("TSQualifiedName", ...args); +} + +function tsCallSignatureDeclaration(...args) { + return (0, _builder.default)("TSCallSignatureDeclaration", ...args); +} + +function tsConstructSignatureDeclaration(...args) { + return (0, _builder.default)("TSConstructSignatureDeclaration", ...args); +} + +function tsPropertySignature(...args) { + return (0, _builder.default)("TSPropertySignature", ...args); +} + +function tsMethodSignature(...args) { + return (0, _builder.default)("TSMethodSignature", ...args); +} + +function tsIndexSignature(...args) { + return (0, _builder.default)("TSIndexSignature", ...args); +} + +function tsAnyKeyword(...args) { + return (0, _builder.default)("TSAnyKeyword", ...args); +} + +function tsBooleanKeyword(...args) { + return (0, _builder.default)("TSBooleanKeyword", ...args); +} + +function tsBigIntKeyword(...args) { + return (0, _builder.default)("TSBigIntKeyword", ...args); +} + +function tsIntrinsicKeyword(...args) { + return (0, _builder.default)("TSIntrinsicKeyword", ...args); +} + +function tsNeverKeyword(...args) { + return (0, _builder.default)("TSNeverKeyword", ...args); +} + +function tsNullKeyword(...args) { + return (0, _builder.default)("TSNullKeyword", ...args); +} + +function tsNumberKeyword(...args) { + return (0, _builder.default)("TSNumberKeyword", ...args); +} + +function tsObjectKeyword(...args) { + return (0, _builder.default)("TSObjectKeyword", ...args); +} + +function tsStringKeyword(...args) { + return (0, _builder.default)("TSStringKeyword", ...args); +} + +function tsSymbolKeyword(...args) { + return (0, _builder.default)("TSSymbolKeyword", ...args); +} + +function tsUndefinedKeyword(...args) { + return (0, _builder.default)("TSUndefinedKeyword", ...args); +} + +function tsUnknownKeyword(...args) { + return (0, _builder.default)("TSUnknownKeyword", ...args); +} + +function tsVoidKeyword(...args) { + return (0, _builder.default)("TSVoidKeyword", ...args); +} + +function tsThisType(...args) { + return (0, _builder.default)("TSThisType", ...args); +} + +function tsFunctionType(...args) { + return (0, _builder.default)("TSFunctionType", ...args); +} + +function tsConstructorType(...args) { + return (0, _builder.default)("TSConstructorType", ...args); +} + +function tsTypeReference(...args) { + return (0, _builder.default)("TSTypeReference", ...args); +} + +function tsTypePredicate(...args) { + return (0, _builder.default)("TSTypePredicate", ...args); +} + +function tsTypeQuery(...args) { + return (0, _builder.default)("TSTypeQuery", ...args); +} + +function tsTypeLiteral(...args) { + return (0, _builder.default)("TSTypeLiteral", ...args); +} + +function tsArrayType(...args) { + return (0, _builder.default)("TSArrayType", ...args); +} + +function tsTupleType(...args) { + return (0, _builder.default)("TSTupleType", ...args); +} + +function tsOptionalType(...args) { + return (0, _builder.default)("TSOptionalType", ...args); +} + +function tsRestType(...args) { + return (0, _builder.default)("TSRestType", ...args); +} + +function tsNamedTupleMember(...args) { + return (0, _builder.default)("TSNamedTupleMember", ...args); +} + +function tsUnionType(...args) { + return (0, _builder.default)("TSUnionType", ...args); +} + +function tsIntersectionType(...args) { + return (0, _builder.default)("TSIntersectionType", ...args); +} + +function tsConditionalType(...args) { + return (0, _builder.default)("TSConditionalType", ...args); +} + +function tsInferType(...args) { + return (0, _builder.default)("TSInferType", ...args); +} + +function tsParenthesizedType(...args) { + return (0, _builder.default)("TSParenthesizedType", ...args); +} + +function tsTypeOperator(...args) { + return (0, _builder.default)("TSTypeOperator", ...args); +} + +function tsIndexedAccessType(...args) { + return (0, _builder.default)("TSIndexedAccessType", ...args); +} + +function tsMappedType(...args) { + return (0, _builder.default)("TSMappedType", ...args); +} + +function tsLiteralType(...args) { + return (0, _builder.default)("TSLiteralType", ...args); +} + +function tsExpressionWithTypeArguments(...args) { + return (0, _builder.default)("TSExpressionWithTypeArguments", ...args); +} + +function tsInterfaceDeclaration(...args) { + return (0, _builder.default)("TSInterfaceDeclaration", ...args); +} + +function tsInterfaceBody(...args) { + return (0, _builder.default)("TSInterfaceBody", ...args); +} + +function tsTypeAliasDeclaration(...args) { + return (0, _builder.default)("TSTypeAliasDeclaration", ...args); +} + +function tsAsExpression(...args) { + return (0, _builder.default)("TSAsExpression", ...args); +} + +function tsTypeAssertion(...args) { + return (0, _builder.default)("TSTypeAssertion", ...args); +} + +function tsEnumDeclaration(...args) { + return (0, _builder.default)("TSEnumDeclaration", ...args); +} + +function tsEnumMember(...args) { + return (0, _builder.default)("TSEnumMember", ...args); +} + +function tsModuleDeclaration(...args) { + return (0, _builder.default)("TSModuleDeclaration", ...args); +} + +function tsModuleBlock(...args) { + return (0, _builder.default)("TSModuleBlock", ...args); +} + +function tsImportType(...args) { + return (0, _builder.default)("TSImportType", ...args); +} + +function tsImportEqualsDeclaration(...args) { + return (0, _builder.default)("TSImportEqualsDeclaration", ...args); +} + +function tsExternalModuleReference(...args) { + return (0, _builder.default)("TSExternalModuleReference", ...args); +} + +function tsNonNullExpression(...args) { + return (0, _builder.default)("TSNonNullExpression", ...args); +} + +function tsExportAssignment(...args) { + return (0, _builder.default)("TSExportAssignment", ...args); +} + +function tsNamespaceExportDeclaration(...args) { + return (0, _builder.default)("TSNamespaceExportDeclaration", ...args); +} + +function tsTypeAnnotation(...args) { + return (0, _builder.default)("TSTypeAnnotation", ...args); +} + +function tsTypeParameterInstantiation(...args) { + return (0, _builder.default)("TSTypeParameterInstantiation", ...args); +} + +function tsTypeParameterDeclaration(...args) { + return (0, _builder.default)("TSTypeParameterDeclaration", ...args); +} + +function tsTypeParameter(...args) { + return (0, _builder.default)("TSTypeParameter", ...args); +} + +function NumberLiteral(...args) { + console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); + return (0, _builder.default)("NumberLiteral", ...args); +} + +function RegexLiteral(...args) { + console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"); + return (0, _builder.default)("RegexLiteral", ...args); +} + +function RestProperty(...args) { + console.trace("The node type RestProperty has been renamed to RestElement"); + return (0, _builder.default)("RestProperty", ...args); +} + +function SpreadProperty(...args) { + console.trace("The node type SpreadProperty has been renamed to SpreadElement"); + return (0, _builder.default)("SpreadProperty", ...args); +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/react/buildChildren.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/react/buildChildren.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/react/buildChildren.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/react/buildChildren.js diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js new file mode 100644 index 00000000000000..7dbe885f2c42b3 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = createTSUnionType; + +var _generated = require("../generated"); + +var _removeTypeDuplicates = _interopRequireDefault(require("../../modifications/typescript/removeTypeDuplicates")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function createTSUnionType(typeAnnotations) { + const types = typeAnnotations.map(type => type.typeAnnotations); + const flattened = (0, _removeTypeDuplicates.default)(types); + + if (flattened.length === 1) { + return flattened[0]; + } else { + return (0, _generated.tsUnionType)(flattened); + } +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/clone.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/clone.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/clone.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/clone.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneDeep.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneDeep.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneDeep.js diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js new file mode 100644 index 00000000000000..d8612e9ebb1598 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = cloneDeepWithoutLoc; + +var _cloneNode = _interopRequireDefault(require("./cloneNode")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function cloneDeepWithoutLoc(node) { + return (0, _cloneNode.default)(node, true, true); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneNode.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneNode.js new file mode 100644 index 00000000000000..44032e3f9d896f --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneNode.js @@ -0,0 +1,101 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = cloneNode; + +var _definitions = require("../definitions"); + +const has = Function.call.bind(Object.prototype.hasOwnProperty); + +function cloneIfNode(obj, deep, withoutLoc) { + if (obj && typeof obj.type === "string") { + return cloneNode(obj, deep, withoutLoc); + } + + return obj; +} + +function cloneIfNodeOrArray(obj, deep, withoutLoc) { + if (Array.isArray(obj)) { + return obj.map(node => cloneIfNode(node, deep, withoutLoc)); + } + + return cloneIfNode(obj, deep, withoutLoc); +} + +function cloneNode(node, deep = true, withoutLoc = false) { + if (!node) return node; + const { + type + } = node; + const newNode = { + type + }; + + if (type === "Identifier") { + newNode.name = node.name; + + if (has(node, "optional") && typeof node.optional === "boolean") { + newNode.optional = node.optional; + } + + if (has(node, "typeAnnotation")) { + newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc) : node.typeAnnotation; + } + } else if (!has(_definitions.NODE_FIELDS, type)) { + throw new Error(`Unknown node type: "${type}"`); + } else { + for (const field of Object.keys(_definitions.NODE_FIELDS[type])) { + if (has(node, field)) { + if (deep) { + newNode[field] = type === "File" && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc) : cloneIfNodeOrArray(node[field], true, withoutLoc); + } else { + newNode[field] = node[field]; + } + } + } + } + + if (has(node, "loc")) { + if (withoutLoc) { + newNode.loc = null; + } else { + newNode.loc = node.loc; + } + } + + if (has(node, "leadingComments")) { + newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc); + } + + if (has(node, "innerComments")) { + newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc); + } + + if (has(node, "trailingComments")) { + newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc); + } + + if (has(node, "extra")) { + newNode.extra = Object.assign({}, node.extra); + } + + return newNode; +} + +function cloneCommentsWithoutLoc(comments) { + return comments.map(({ + type, + value + }) => ({ + type, + value, + loc: null + })); +} + +function maybeCloneComments(comments, deep, withoutLoc) { + return deep && withoutLoc ? cloneCommentsWithoutLoc(comments) : comments; +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js similarity index 63% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js index 5622af7b0220d7..34fd172ed77511 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js @@ -5,12 +5,10 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = cloneWithoutLoc; -var _clone = _interopRequireDefault(require("./clone")); +var _cloneNode = _interopRequireDefault(require("./cloneNode")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function cloneWithoutLoc(node) { - const newNode = (0, _clone.default)(node); - newNode.loc = null; - return newNode; + return (0, _cloneNode.default)(node, false, true); } \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComment.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/addComment.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComment.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/addComment.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/addComments.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/addComments.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/addComments.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritInnerComments.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/inheritInnerComments.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritInnerComments.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/inheritInnerComments.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritLeadingComments.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/inheritLeadingComments.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritLeadingComments.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/inheritLeadingComments.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritTrailingComments.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/inheritTrailingComments.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritTrailingComments.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/inheritTrailingComments.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritsComments.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/inheritsComments.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/inheritsComments.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/inheritsComments.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/removeComments.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/removeComments.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/comments/removeComments.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/comments/removeComments.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/generated/index.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/constants/generated/index.js similarity index 75% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/generated/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/constants/generated/index.js index 6072495e206be0..2c308098e8eb56 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/generated/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/constants/generated/index.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.PRIVATE_TYPES = exports.JSX_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.FLOWTYPE_TYPES = exports.FLOW_TYPES = exports.MODULESPECIFIER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.MODULEDECLARATION_TYPES = exports.CLASS_TYPES = exports.PATTERN_TYPES = exports.UNARYLIKE_TYPES = exports.PROPERTY_TYPES = exports.OBJECTMEMBER_TYPES = exports.METHOD_TYPES = exports.USERWHITESPACABLE_TYPES = exports.IMMUTABLE_TYPES = exports.LITERAL_TYPES = exports.TSENTITYNAME_TYPES = exports.LVAL_TYPES = exports.PATTERNLIKE_TYPES = exports.DECLARATION_TYPES = exports.PUREISH_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FUNCTION_TYPES = exports.FORXSTATEMENT_TYPES = exports.FOR_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.WHILE_TYPES = exports.LOOP_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.SCOPABLE_TYPES = exports.BINARY_TYPES = exports.EXPRESSION_TYPES = void 0; +exports.TSBASETYPE_TYPES = exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.PRIVATE_TYPES = exports.JSX_TYPES = exports.ENUMMEMBER_TYPES = exports.ENUMBODY_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.FLOWTYPE_TYPES = exports.FLOW_TYPES = exports.MODULESPECIFIER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.MODULEDECLARATION_TYPES = exports.CLASS_TYPES = exports.PATTERN_TYPES = exports.UNARYLIKE_TYPES = exports.PROPERTY_TYPES = exports.OBJECTMEMBER_TYPES = exports.METHOD_TYPES = exports.USERWHITESPACABLE_TYPES = exports.IMMUTABLE_TYPES = exports.LITERAL_TYPES = exports.TSENTITYNAME_TYPES = exports.LVAL_TYPES = exports.PATTERNLIKE_TYPES = exports.DECLARATION_TYPES = exports.PUREISH_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FUNCTION_TYPES = exports.FORXSTATEMENT_TYPES = exports.FOR_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.WHILE_TYPES = exports.LOOP_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.SCOPABLE_TYPES = exports.BINARY_TYPES = exports.EXPRESSION_TYPES = void 0; var _definitions = require("../../definitions"); @@ -83,6 +83,10 @@ const FLOWDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowDeclaration"] exports.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES; const FLOWPREDICATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowPredicate"]; exports.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES; +const ENUMBODY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["EnumBody"]; +exports.ENUMBODY_TYPES = ENUMBODY_TYPES; +const ENUMMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["EnumMember"]; +exports.ENUMMEMBER_TYPES = ENUMMEMBER_TYPES; const JSX_TYPES = _definitions.FLIPPED_ALIAS_KEYS["JSX"]; exports.JSX_TYPES = JSX_TYPES; const PRIVATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Private"]; @@ -90,4 +94,6 @@ exports.PRIVATE_TYPES = PRIVATE_TYPES; const TSTYPEELEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSTypeElement"]; exports.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES; const TSTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSType"]; -exports.TSTYPE_TYPES = TSTYPE_TYPES; \ No newline at end of file +exports.TSTYPE_TYPES = TSTYPE_TYPES; +const TSBASETYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSBaseType"]; +exports.TSBASETYPE_TYPES = TSBASETYPE_TYPES; \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/index.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/constants/index.js similarity index 81% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/constants/index.js index a60b106fdad394..7553162c6641e6 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/constants/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/constants/index.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = void 0; +exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.ASSIGNMENT_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = void 0; const STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; exports.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS; const FLATTENABLE_KEYS = ["body", "expressions"]; @@ -28,6 +28,8 @@ const NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>" exports.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS; const BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS]; exports.BINARY_OPERATORS = BINARY_OPERATORS; +const ASSIGNMENT_OPERATORS = ["=", "+=", ...NUMBER_BINARY_OPERATORS.map(op => op + "="), ...LOGICAL_OPERATORS.map(op => op + "=")]; +exports.ASSIGNMENT_OPERATORS = ASSIGNMENT_OPERATORS; const BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; exports.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS; const NUMBER_UNARY_OPERATORS = ["+", "-", "~"]; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/ensureBlock.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/ensureBlock.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/ensureBlock.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/ensureBlock.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js similarity index 92% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js index fadd0f04be0270..bae4e8f380c48b 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js @@ -20,7 +20,9 @@ function gatherSequenceExpressions(nodes, scope, declars) { let ensureLastUndefined = true; for (const node of nodes) { - ensureLastUndefined = false; + if (!(0, _generated.isEmptyStatement)(node)) { + ensureLastUndefined = false; + } if ((0, _generated.isExpression)(node)) { exprs.push(node); @@ -55,7 +57,9 @@ function gatherSequenceExpressions(nodes, scope, declars) { if (!body) return; exprs.push(body); } else if ((0, _generated.isEmptyStatement)(node)) { - ensureLastUndefined = true; + if (nodes.indexOf(node) === 0) { + ensureLastUndefined = true; + } } else { return; } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBlock.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toBlock.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toBlock.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toBlock.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toComputedKey.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toComputedKey.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toComputedKey.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toComputedKey.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toExpression.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toExpression.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toExpression.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toExpression.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toIdentifier.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toIdentifier.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toIdentifier.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toIdentifier.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toKeyAlias.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toKeyAlias.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toKeyAlias.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toKeyAlias.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toSequenceExpression.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toSequenceExpression.js similarity index 91% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toSequenceExpression.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toSequenceExpression.js index 2e221db4e07042..4b61276ce6330d 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toSequenceExpression.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toSequenceExpression.js @@ -10,7 +10,7 @@ var _gatherSequenceExpressions = _interopRequireDefault(require("./gatherSequenc function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function toSequenceExpression(nodes, scope) { - if (!nodes || !nodes.length) return; + if (!(nodes == null ? void 0 : nodes.length)) return; const declars = []; const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars); if (!result) return; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toStatement.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toStatement.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/toStatement.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/toStatement.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/valueToNode.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/valueToNode.js similarity index 83% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/valueToNode.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/valueToNode.js index 9e19dbfa76abba..d1118e164b0aa4 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/converters/valueToNode.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/converters/valueToNode.js @@ -5,25 +5,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = valueToNode; -function _isPlainObject() { - const data = _interopRequireDefault(require("lodash/isPlainObject")); +var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject")); - _isPlainObject = function () { - return data; - }; - - return data; -} - -function _isRegExp() { - const data = _interopRequireDefault(require("lodash/isRegExp")); - - _isRegExp = function () { - return data; - }; - - return data; -} +var _isRegExp = _interopRequireDefault(require("lodash/isRegExp")); var _isValidIdentifier = _interopRequireDefault(require("../validators/isValidIdentifier")); @@ -72,7 +56,7 @@ function valueToNode(value) { return result; } - if ((0, _isRegExp().default)(value)) { + if ((0, _isRegExp.default)(value)) { const pattern = value.source; const flags = value.toString().match(/\/([a-z]+|)$/)[1]; return (0, _generated.regExpLiteral)(pattern, flags); @@ -82,7 +66,7 @@ function valueToNode(value) { return (0, _generated.arrayExpression)(value.map(valueToNode)); } - if ((0, _isPlainObject().default)(value)) { + if ((0, _isPlainObject.default)(value)) { const props = []; for (const key of Object.keys(value)) { diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/core.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/core.js new file mode 100644 index 00000000000000..d6cb97eac285fb --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/core.js @@ -0,0 +1,1488 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.classMethodOrDeclareMethodCommon = exports.classMethodOrPropertyCommon = exports.patternLikeCommon = exports.functionDeclarationCommon = exports.functionTypeAnnotationCommon = exports.functionCommon = void 0; + +var _is = _interopRequireDefault(require("../validators/is")); + +var _isValidIdentifier = _interopRequireDefault(require("../validators/isValidIdentifier")); + +var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); + +var _constants = require("../constants"); + +var _utils = _interopRequireWildcard(require("./utils")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(0, _utils.default)("ArrayExpression", { + fields: { + elements: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement"))), + default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined + } + }, + visitor: ["elements"], + aliases: ["Expression"] +}); +(0, _utils.default)("AssignmentExpression", { + fields: { + operator: { + validate: function () { + if (!process.env.BABEL_TYPES_8_BREAKING) { + return (0, _utils.assertValueType)("string"); + } + + const identifier = (0, _utils.assertOneOf)(..._constants.ASSIGNMENT_OPERATORS); + const pattern = (0, _utils.assertOneOf)("="); + return function (node, key, val) { + const validator = (0, _is.default)("Pattern", node.left) ? pattern : identifier; + validator(node, key, val); + }; + }() + }, + left: { + validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern") + }, + right: { + validate: (0, _utils.assertNodeType)("Expression") + } + }, + builder: ["operator", "left", "right"], + visitor: ["left", "right"], + aliases: ["Expression"] +}); +(0, _utils.default)("BinaryExpression", { + builder: ["operator", "left", "right"], + fields: { + operator: { + validate: (0, _utils.assertOneOf)(..._constants.BINARY_OPERATORS) + }, + left: { + validate: function () { + const expression = (0, _utils.assertNodeType)("Expression"); + const inOp = (0, _utils.assertNodeType)("Expression", "PrivateName"); + + const validator = function (node, key, val) { + const validator = node.operator === "in" ? inOp : expression; + validator(node, key, val); + }; + + validator.oneOfNodeTypes = ["Expression", "PrivateName"]; + return validator; + }() + }, + right: { + validate: (0, _utils.assertNodeType)("Expression") + } + }, + visitor: ["left", "right"], + aliases: ["Binary", "Expression"] +}); +(0, _utils.default)("InterpreterDirective", { + builder: ["value"], + fields: { + value: { + validate: (0, _utils.assertValueType)("string") + } + } +}); +(0, _utils.default)("Directive", { + visitor: ["value"], + fields: { + value: { + validate: (0, _utils.assertNodeType)("DirectiveLiteral") + } + } +}); +(0, _utils.default)("DirectiveLiteral", { + builder: ["value"], + fields: { + value: { + validate: (0, _utils.assertValueType)("string") + } + } +}); +(0, _utils.default)("BlockStatement", { + builder: ["body", "directives"], + visitor: ["directives", "body"], + fields: { + directives: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))), + default: [] + }, + body: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) + } + }, + aliases: ["Scopable", "BlockParent", "Block", "Statement"] +}); +(0, _utils.default)("BreakStatement", { + visitor: ["label"], + fields: { + label: { + validate: (0, _utils.assertNodeType)("Identifier"), + optional: true + } + }, + aliases: ["Statement", "Terminatorless", "CompletionStatement"] +}); +(0, _utils.default)("CallExpression", { + visitor: ["callee", "arguments", "typeParameters", "typeArguments"], + builder: ["callee", "arguments"], + aliases: ["Expression"], + fields: Object.assign({ + callee: { + validate: (0, _utils.assertNodeType)("Expression", "V8IntrinsicIdentifier") + }, + arguments: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder"))) + } + }, !process.env.BABEL_TYPES_8_BREAKING ? { + optional: { + validate: (0, _utils.assertOneOf)(true, false), + optional: true + } + } : {}, { + typeArguments: { + validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), + optional: true + }, + typeParameters: { + validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), + optional: true + } + }) +}); +(0, _utils.default)("CatchClause", { + visitor: ["param", "body"], + fields: { + param: { + validate: (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"), + optional: true + }, + body: { + validate: (0, _utils.assertNodeType)("BlockStatement") + } + }, + aliases: ["Scopable", "BlockParent"] +}); +(0, _utils.default)("ConditionalExpression", { + visitor: ["test", "consequent", "alternate"], + fields: { + test: { + validate: (0, _utils.assertNodeType)("Expression") + }, + consequent: { + validate: (0, _utils.assertNodeType)("Expression") + }, + alternate: { + validate: (0, _utils.assertNodeType)("Expression") + } + }, + aliases: ["Expression", "Conditional"] +}); +(0, _utils.default)("ContinueStatement", { + visitor: ["label"], + fields: { + label: { + validate: (0, _utils.assertNodeType)("Identifier"), + optional: true + } + }, + aliases: ["Statement", "Terminatorless", "CompletionStatement"] +}); +(0, _utils.default)("DebuggerStatement", { + aliases: ["Statement"] +}); +(0, _utils.default)("DoWhileStatement", { + visitor: ["test", "body"], + fields: { + test: { + validate: (0, _utils.assertNodeType)("Expression") + }, + body: { + validate: (0, _utils.assertNodeType)("Statement") + } + }, + aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"] +}); +(0, _utils.default)("EmptyStatement", { + aliases: ["Statement"] +}); +(0, _utils.default)("ExpressionStatement", { + visitor: ["expression"], + fields: { + expression: { + validate: (0, _utils.assertNodeType)("Expression") + } + }, + aliases: ["Statement", "ExpressionWrapper"] +}); +(0, _utils.default)("File", { + builder: ["program", "comments", "tokens"], + visitor: ["program"], + fields: { + program: { + validate: (0, _utils.assertNodeType)("Program") + }, + comments: { + validate: !process.env.BABEL_TYPES_8_BREAKING ? Object.assign(() => {}, { + each: { + oneOfNodeTypes: ["CommentBlock", "CommentLine"] + } + }) : (0, _utils.assertEach)((0, _utils.assertNodeType)("CommentBlock", "CommentLine")), + optional: true + }, + tokens: { + validate: (0, _utils.assertEach)(Object.assign(() => {}, { + type: "any" + })), + optional: true + } + } +}); +(0, _utils.default)("ForInStatement", { + visitor: ["left", "right", "body"], + aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], + fields: { + left: { + validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern") + }, + right: { + validate: (0, _utils.assertNodeType)("Expression") + }, + body: { + validate: (0, _utils.assertNodeType)("Statement") + } + } +}); +(0, _utils.default)("ForStatement", { + visitor: ["init", "test", "update", "body"], + aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"], + fields: { + init: { + validate: (0, _utils.assertNodeType)("VariableDeclaration", "Expression"), + optional: true + }, + test: { + validate: (0, _utils.assertNodeType)("Expression"), + optional: true + }, + update: { + validate: (0, _utils.assertNodeType)("Expression"), + optional: true + }, + body: { + validate: (0, _utils.assertNodeType)("Statement") + } + } +}); +const functionCommon = { + params: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty"))) + }, + generator: { + default: false + }, + async: { + default: false + } +}; +exports.functionCommon = functionCommon; +const functionTypeAnnotationCommon = { + returnType: { + validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), + optional: true + }, + typeParameters: { + validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), + optional: true + } +}; +exports.functionTypeAnnotationCommon = functionTypeAnnotationCommon; +const functionDeclarationCommon = Object.assign({}, functionCommon, { + declare: { + validate: (0, _utils.assertValueType)("boolean"), + optional: true + }, + id: { + validate: (0, _utils.assertNodeType)("Identifier"), + optional: true + } +}); +exports.functionDeclarationCommon = functionDeclarationCommon; +(0, _utils.default)("FunctionDeclaration", { + builder: ["id", "params", "body", "generator", "async"], + visitor: ["id", "params", "body", "returnType", "typeParameters"], + fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, { + body: { + validate: (0, _utils.assertNodeType)("BlockStatement") + } + }), + aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"], + validate: function () { + if (!process.env.BABEL_TYPES_8_BREAKING) return () => {}; + const identifier = (0, _utils.assertNodeType)("Identifier"); + return function (parent, key, node) { + if (!(0, _is.default)("ExportDefaultDeclaration", parent)) { + identifier(node, "id", node.id); + } + }; + }() +}); +(0, _utils.default)("FunctionExpression", { + inherits: "FunctionDeclaration", + aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], + fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { + id: { + validate: (0, _utils.assertNodeType)("Identifier"), + optional: true + }, + body: { + validate: (0, _utils.assertNodeType)("BlockStatement") + } + }) +}); +const patternLikeCommon = { + typeAnnotation: { + validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), + optional: true + }, + decorators: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))) + } +}; +exports.patternLikeCommon = patternLikeCommon; +(0, _utils.default)("Identifier", { + builder: ["name"], + visitor: ["typeAnnotation", "decorators"], + aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"], + fields: Object.assign({}, patternLikeCommon, { + name: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (!(0, _isValidIdentifier.default)(val, false)) { + throw new TypeError(`"${val}" is not a valid identifier name`); + } + }, { + type: "string" + })) + }, + optional: { + validate: (0, _utils.assertValueType)("boolean"), + optional: true + } + }), + + validate(parent, key, node) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + const match = /\.(\w+)$/.exec(key); + if (!match) return; + const [, parentKey] = match; + const nonComp = { + computed: false + }; + + if (parentKey === "property") { + if ((0, _is.default)("MemberExpression", parent, nonComp)) return; + if ((0, _is.default)("OptionalMemberExpression", parent, nonComp)) return; + } else if (parentKey === "key") { + if ((0, _is.default)("Property", parent, nonComp)) return; + if ((0, _is.default)("Method", parent, nonComp)) return; + } else if (parentKey === "exported") { + if ((0, _is.default)("ExportSpecifier", parent)) return; + } else if (parentKey === "imported") { + if ((0, _is.default)("ImportSpecifier", parent, { + imported: node + })) return; + } else if (parentKey === "meta") { + if ((0, _is.default)("MetaProperty", parent, { + meta: node + })) return; + } + + if (((0, _helperValidatorIdentifier.isKeyword)(node.name) || (0, _helperValidatorIdentifier.isReservedWord)(node.name)) && node.name !== "this") { + throw new TypeError(`"${node.name}" is not a valid identifier`); + } + } + +}); +(0, _utils.default)("IfStatement", { + visitor: ["test", "consequent", "alternate"], + aliases: ["Statement", "Conditional"], + fields: { + test: { + validate: (0, _utils.assertNodeType)("Expression") + }, + consequent: { + validate: (0, _utils.assertNodeType)("Statement") + }, + alternate: { + optional: true, + validate: (0, _utils.assertNodeType)("Statement") + } + } +}); +(0, _utils.default)("LabeledStatement", { + visitor: ["label", "body"], + aliases: ["Statement"], + fields: { + label: { + validate: (0, _utils.assertNodeType)("Identifier") + }, + body: { + validate: (0, _utils.assertNodeType)("Statement") + } + } +}); +(0, _utils.default)("StringLiteral", { + builder: ["value"], + fields: { + value: { + validate: (0, _utils.assertValueType)("string") + } + }, + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); +(0, _utils.default)("NumericLiteral", { + builder: ["value"], + deprecatedAlias: "NumberLiteral", + fields: { + value: { + validate: (0, _utils.assertValueType)("number") + } + }, + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); +(0, _utils.default)("NullLiteral", { + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); +(0, _utils.default)("BooleanLiteral", { + builder: ["value"], + fields: { + value: { + validate: (0, _utils.assertValueType)("boolean") + } + }, + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); +(0, _utils.default)("RegExpLiteral", { + builder: ["pattern", "flags"], + deprecatedAlias: "RegexLiteral", + aliases: ["Expression", "Pureish", "Literal"], + fields: { + pattern: { + validate: (0, _utils.assertValueType)("string") + }, + flags: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + const invalid = /[^gimsuy]/.exec(val); + + if (invalid) { + throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`); + } + }, { + type: "string" + })), + default: "" + } + } +}); +(0, _utils.default)("LogicalExpression", { + builder: ["operator", "left", "right"], + visitor: ["left", "right"], + aliases: ["Binary", "Expression"], + fields: { + operator: { + validate: (0, _utils.assertOneOf)(..._constants.LOGICAL_OPERATORS) + }, + left: { + validate: (0, _utils.assertNodeType)("Expression") + }, + right: { + validate: (0, _utils.assertNodeType)("Expression") + } + } +}); +(0, _utils.default)("MemberExpression", { + builder: ["object", "property", "computed", "optional"], + visitor: ["object", "property"], + aliases: ["Expression", "LVal"], + fields: Object.assign({ + object: { + validate: (0, _utils.assertNodeType)("Expression") + }, + property: { + validate: function () { + const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName"); + const computed = (0, _utils.assertNodeType)("Expression"); + + const validator = function (node, key, val) { + const validator = node.computed ? computed : normal; + validator(node, key, val); + }; + + validator.oneOfNodeTypes = ["Expression", "Identifier", "PrivateName"]; + return validator; + }() + }, + computed: { + default: false + } + }, !process.env.BABEL_TYPES_8_BREAKING ? { + optional: { + validate: (0, _utils.assertOneOf)(true, false), + optional: true + } + } : {}) +}); +(0, _utils.default)("NewExpression", { + inherits: "CallExpression" +}); +(0, _utils.default)("Program", { + visitor: ["directives", "body"], + builder: ["body", "directives", "sourceType", "interpreter"], + fields: { + sourceFile: { + validate: (0, _utils.assertValueType)("string") + }, + sourceType: { + validate: (0, _utils.assertOneOf)("script", "module"), + default: "script" + }, + interpreter: { + validate: (0, _utils.assertNodeType)("InterpreterDirective"), + default: null, + optional: true + }, + directives: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))), + default: [] + }, + body: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) + } + }, + aliases: ["Scopable", "BlockParent", "Block"] +}); +(0, _utils.default)("ObjectExpression", { + visitor: ["properties"], + aliases: ["Expression"], + fields: { + properties: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement"))) + } + } +}); +(0, _utils.default)("ObjectMethod", { + builder: ["kind", "key", "params", "body", "computed", "generator", "async"], + fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { + kind: Object.assign({ + validate: (0, _utils.assertOneOf)("method", "get", "set") + }, !process.env.BABEL_TYPES_8_BREAKING ? { + default: "method" + } : {}), + computed: { + default: false + }, + key: { + validate: function () { + const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); + const computed = (0, _utils.assertNodeType)("Expression"); + + const validator = function (node, key, val) { + const validator = node.computed ? computed : normal; + validator(node, key, val); + }; + + validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"]; + return validator; + }() + }, + decorators: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), + optional: true + }, + body: { + validate: (0, _utils.assertNodeType)("BlockStatement") + } + }), + visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], + aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"] +}); +(0, _utils.default)("ObjectProperty", { + builder: ["key", "value", "computed", "shorthand", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : [])], + fields: { + computed: { + default: false + }, + key: { + validate: function () { + const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); + const computed = (0, _utils.assertNodeType)("Expression"); + + const validator = function (node, key, val) { + const validator = node.computed ? computed : normal; + validator(node, key, val); + }; + + validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"]; + return validator; + }() + }, + value: { + validate: (0, _utils.assertNodeType)("Expression", "PatternLike") + }, + shorthand: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (val && node.computed) { + throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true"); + } + }, { + type: "boolean" + }), function (node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (val && !(0, _is.default)("Identifier", node.key)) { + throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier"); + } + }), + default: false + }, + decorators: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), + optional: true + } + }, + visitor: ["key", "value", "decorators"], + aliases: ["UserWhitespacable", "Property", "ObjectMember"], + validate: function () { + const pattern = (0, _utils.assertNodeType)("Identifier", "Pattern"); + const expression = (0, _utils.assertNodeType)("Expression"); + return function (parent, key, node) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + const validator = (0, _is.default)("ObjectPattern", parent) ? pattern : expression; + validator(node, "value", node.value); + }; + }() +}); +(0, _utils.default)("RestElement", { + visitor: ["argument", "typeAnnotation"], + builder: ["argument"], + aliases: ["LVal", "PatternLike"], + deprecatedAlias: "RestProperty", + fields: Object.assign({}, patternLikeCommon, { + argument: { + validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "Pattern", "MemberExpression") + } + }), + + validate(parent, key) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + const match = /(\w+)\[(\d+)\]/.exec(key); + if (!match) throw new Error("Internal Babel error: malformed key."); + const [, listKey, index] = match; + + if (parent[listKey].length > index + 1) { + throw new TypeError(`RestElement must be last element of ${listKey}`); + } + } + +}); +(0, _utils.default)("ReturnStatement", { + visitor: ["argument"], + aliases: ["Statement", "Terminatorless", "CompletionStatement"], + fields: { + argument: { + validate: (0, _utils.assertNodeType)("Expression"), + optional: true + } + } +}); +(0, _utils.default)("SequenceExpression", { + visitor: ["expressions"], + fields: { + expressions: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression"))) + } + }, + aliases: ["Expression"] +}); +(0, _utils.default)("ParenthesizedExpression", { + visitor: ["expression"], + aliases: ["Expression", "ExpressionWrapper"], + fields: { + expression: { + validate: (0, _utils.assertNodeType)("Expression") + } + } +}); +(0, _utils.default)("SwitchCase", { + visitor: ["test", "consequent"], + fields: { + test: { + validate: (0, _utils.assertNodeType)("Expression"), + optional: true + }, + consequent: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) + } + } +}); +(0, _utils.default)("SwitchStatement", { + visitor: ["discriminant", "cases"], + aliases: ["Statement", "BlockParent", "Scopable"], + fields: { + discriminant: { + validate: (0, _utils.assertNodeType)("Expression") + }, + cases: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("SwitchCase"))) + } + } +}); +(0, _utils.default)("ThisExpression", { + aliases: ["Expression"] +}); +(0, _utils.default)("ThrowStatement", { + visitor: ["argument"], + aliases: ["Statement", "Terminatorless", "CompletionStatement"], + fields: { + argument: { + validate: (0, _utils.assertNodeType)("Expression") + } + } +}); +(0, _utils.default)("TryStatement", { + visitor: ["block", "handler", "finalizer"], + aliases: ["Statement"], + fields: { + block: { + validate: (0, _utils.chain)((0, _utils.assertNodeType)("BlockStatement"), Object.assign(function (node) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (!node.handler && !node.finalizer) { + throw new TypeError("TryStatement expects either a handler or finalizer, or both"); + } + }, { + oneOfNodeTypes: ["BlockStatement"] + })) + }, + handler: { + optional: true, + validate: (0, _utils.assertNodeType)("CatchClause") + }, + finalizer: { + optional: true, + validate: (0, _utils.assertNodeType)("BlockStatement") + } + } +}); +(0, _utils.default)("UnaryExpression", { + builder: ["operator", "argument", "prefix"], + fields: { + prefix: { + default: true + }, + argument: { + validate: (0, _utils.assertNodeType)("Expression") + }, + operator: { + validate: (0, _utils.assertOneOf)(..._constants.UNARY_OPERATORS) + } + }, + visitor: ["argument"], + aliases: ["UnaryLike", "Expression"] +}); +(0, _utils.default)("UpdateExpression", { + builder: ["operator", "argument", "prefix"], + fields: { + prefix: { + default: false + }, + argument: { + validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("Expression") : (0, _utils.assertNodeType)("Identifier", "MemberExpression") + }, + operator: { + validate: (0, _utils.assertOneOf)(..._constants.UPDATE_OPERATORS) + } + }, + visitor: ["argument"], + aliases: ["Expression"] +}); +(0, _utils.default)("VariableDeclaration", { + builder: ["kind", "declarations"], + visitor: ["declarations"], + aliases: ["Statement", "Declaration"], + fields: { + declare: { + validate: (0, _utils.assertValueType)("boolean"), + optional: true + }, + kind: { + validate: (0, _utils.assertOneOf)("var", "let", "const") + }, + declarations: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("VariableDeclarator"))) + } + }, + + validate(parent, key, node) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + if (!(0, _is.default)("ForXStatement", parent, { + left: node + })) return; + + if (node.declarations.length !== 1) { + throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`); + } + } + +}); +(0, _utils.default)("VariableDeclarator", { + visitor: ["id", "init"], + fields: { + id: { + validate: function () { + if (!process.env.BABEL_TYPES_8_BREAKING) { + return (0, _utils.assertNodeType)("LVal"); + } + + const normal = (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"); + const without = (0, _utils.assertNodeType)("Identifier"); + return function (node, key, val) { + const validator = node.init ? normal : without; + validator(node, key, val); + }; + }() + }, + definite: { + optional: true, + validate: (0, _utils.assertValueType)("boolean") + }, + init: { + optional: true, + validate: (0, _utils.assertNodeType)("Expression") + } + } +}); +(0, _utils.default)("WhileStatement", { + visitor: ["test", "body"], + aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"], + fields: { + test: { + validate: (0, _utils.assertNodeType)("Expression") + }, + body: { + validate: (0, _utils.assertNodeType)("Statement") + } + } +}); +(0, _utils.default)("WithStatement", { + visitor: ["object", "body"], + aliases: ["Statement"], + fields: { + object: { + validate: (0, _utils.assertNodeType)("Expression") + }, + body: { + validate: (0, _utils.assertNodeType)("Statement") + } + } +}); +(0, _utils.default)("AssignmentPattern", { + visitor: ["left", "right", "decorators"], + builder: ["left", "right"], + aliases: ["Pattern", "PatternLike", "LVal"], + fields: Object.assign({}, patternLikeCommon, { + left: { + validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression") + }, + right: { + validate: (0, _utils.assertNodeType)("Expression") + }, + decorators: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), + optional: true + } + }) +}); +(0, _utils.default)("ArrayPattern", { + visitor: ["elements", "typeAnnotation"], + builder: ["elements"], + aliases: ["Pattern", "PatternLike", "LVal"], + fields: Object.assign({}, patternLikeCommon, { + elements: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "PatternLike"))) + }, + decorators: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), + optional: true + } + }) +}); +(0, _utils.default)("ArrowFunctionExpression", { + builder: ["params", "body", "async"], + visitor: ["params", "body", "returnType", "typeParameters"], + aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], + fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { + expression: { + validate: (0, _utils.assertValueType)("boolean") + }, + body: { + validate: (0, _utils.assertNodeType)("BlockStatement", "Expression") + } + }) +}); +(0, _utils.default)("ClassBody", { + visitor: ["body"], + fields: { + body: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature"))) + } + } +}); +(0, _utils.default)("ClassExpression", { + builder: ["id", "superClass", "body", "decorators"], + visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"], + aliases: ["Scopable", "Class", "Expression"], + fields: { + id: { + validate: (0, _utils.assertNodeType)("Identifier"), + optional: true + }, + typeParameters: { + validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), + optional: true + }, + body: { + validate: (0, _utils.assertNodeType)("ClassBody") + }, + superClass: { + optional: true, + validate: (0, _utils.assertNodeType)("Expression") + }, + superTypeParameters: { + validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), + optional: true + }, + implements: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))), + optional: true + }, + decorators: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), + optional: true + }, + mixins: { + validate: (0, _utils.assertNodeType)("InterfaceExtends"), + optional: true + } + } +}); +(0, _utils.default)("ClassDeclaration", { + inherits: "ClassExpression", + aliases: ["Scopable", "Class", "Statement", "Declaration"], + fields: { + id: { + validate: (0, _utils.assertNodeType)("Identifier") + }, + typeParameters: { + validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), + optional: true + }, + body: { + validate: (0, _utils.assertNodeType)("ClassBody") + }, + superClass: { + optional: true, + validate: (0, _utils.assertNodeType)("Expression") + }, + superTypeParameters: { + validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), + optional: true + }, + implements: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))), + optional: true + }, + decorators: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), + optional: true + }, + mixins: { + validate: (0, _utils.assertNodeType)("InterfaceExtends"), + optional: true + }, + declare: { + validate: (0, _utils.assertValueType)("boolean"), + optional: true + }, + abstract: { + validate: (0, _utils.assertValueType)("boolean"), + optional: true + } + }, + validate: function () { + const identifier = (0, _utils.assertNodeType)("Identifier"); + return function (parent, key, node) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (!(0, _is.default)("ExportDefaultDeclaration", parent)) { + identifier(node, "id", node.id); + } + }; + }() +}); +(0, _utils.default)("ExportAllDeclaration", { + visitor: ["source"], + aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], + fields: { + source: { + validate: (0, _utils.assertNodeType)("StringLiteral") + }, + assertions: { + optional: true, + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertNodeType)("ImportAttribute")) + } + } +}); +(0, _utils.default)("ExportDefaultDeclaration", { + visitor: ["declaration"], + aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], + fields: { + declaration: { + validate: (0, _utils.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression") + } + } +}); +(0, _utils.default)("ExportNamedDeclaration", { + visitor: ["declaration", "specifiers", "source"], + aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], + fields: { + declaration: { + optional: true, + validate: (0, _utils.chain)((0, _utils.assertNodeType)("Declaration"), Object.assign(function (node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (val && node.specifiers.length) { + throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration"); + } + }, { + oneOfNodeTypes: ["Declaration"] + }), function (node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (val && node.source) { + throw new TypeError("Cannot export a declaration from a source"); + } + }) + }, + assertions: { + optional: true, + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertNodeType)("ImportAttribute")) + }, + specifiers: { + default: [], + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)(function () { + const sourced = (0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier"); + const sourceless = (0, _utils.assertNodeType)("ExportSpecifier"); + if (!process.env.BABEL_TYPES_8_BREAKING) return sourced; + return function (node, key, val) { + const validator = node.source ? sourced : sourceless; + validator(node, key, val); + }; + }())) + }, + source: { + validate: (0, _utils.assertNodeType)("StringLiteral"), + optional: true + }, + exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) + } +}); +(0, _utils.default)("ExportSpecifier", { + visitor: ["local", "exported"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _utils.assertNodeType)("Identifier") + }, + exported: { + validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral") + } + } +}); +(0, _utils.default)("ForOfStatement", { + visitor: ["left", "right", "body"], + builder: ["left", "right", "body", "await"], + aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], + fields: { + left: { + validate: function () { + if (!process.env.BABEL_TYPES_8_BREAKING) { + return (0, _utils.assertNodeType)("VariableDeclaration", "LVal"); + } + + const declaration = (0, _utils.assertNodeType)("VariableDeclaration"); + const lval = (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern"); + return function (node, key, val) { + if ((0, _is.default)("VariableDeclaration", val)) { + declaration(node, key, val); + } else { + lval(node, key, val); + } + }; + }() + }, + right: { + validate: (0, _utils.assertNodeType)("Expression") + }, + body: { + validate: (0, _utils.assertNodeType)("Statement") + }, + await: { + default: false + } + } +}); +(0, _utils.default)("ImportDeclaration", { + visitor: ["specifiers", "source"], + aliases: ["Statement", "Declaration", "ModuleDeclaration"], + fields: { + assertions: { + optional: true, + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertNodeType)("ImportAttribute")) + }, + specifiers: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier"))) + }, + source: { + validate: (0, _utils.assertNodeType)("StringLiteral") + }, + importKind: { + validate: (0, _utils.assertOneOf)("type", "typeof", "value"), + optional: true + } + } +}); +(0, _utils.default)("ImportDefaultSpecifier", { + visitor: ["local"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _utils.assertNodeType)("Identifier") + } + } +}); +(0, _utils.default)("ImportNamespaceSpecifier", { + visitor: ["local"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _utils.assertNodeType)("Identifier") + } + } +}); +(0, _utils.default)("ImportSpecifier", { + visitor: ["local", "imported"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _utils.assertNodeType)("Identifier") + }, + imported: { + validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral") + }, + importKind: { + validate: (0, _utils.assertOneOf)("type", "typeof"), + optional: true + } + } +}); +(0, _utils.default)("MetaProperty", { + visitor: ["meta", "property"], + aliases: ["Expression"], + fields: { + meta: { + validate: (0, _utils.chain)((0, _utils.assertNodeType)("Identifier"), Object.assign(function (node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + let property; + + switch (val.name) { + case "function": + property = "sent"; + break; + + case "new": + property = "target"; + break; + + case "import": + property = "meta"; + break; + } + + if (!(0, _is.default)("Identifier", node.property, { + name: property + })) { + throw new TypeError("Unrecognised MetaProperty"); + } + }, { + oneOfNodeTypes: ["Identifier"] + })) + }, + property: { + validate: (0, _utils.assertNodeType)("Identifier") + } + } +}); +const classMethodOrPropertyCommon = { + abstract: { + validate: (0, _utils.assertValueType)("boolean"), + optional: true + }, + accessibility: { + validate: (0, _utils.assertOneOf)("public", "private", "protected"), + optional: true + }, + static: { + default: false + }, + computed: { + default: false + }, + optional: { + validate: (0, _utils.assertValueType)("boolean"), + optional: true + }, + key: { + validate: (0, _utils.chain)(function () { + const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); + const computed = (0, _utils.assertNodeType)("Expression"); + return function (node, key, val) { + const validator = node.computed ? computed : normal; + validator(node, key, val); + }; + }(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression")) + } +}; +exports.classMethodOrPropertyCommon = classMethodOrPropertyCommon; +const classMethodOrDeclareMethodCommon = Object.assign({}, functionCommon, classMethodOrPropertyCommon, { + kind: { + validate: (0, _utils.assertOneOf)("get", "set", "method", "constructor"), + default: "method" + }, + access: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")), + optional: true + }, + decorators: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), + optional: true + } +}); +exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon; +(0, _utils.default)("ClassMethod", { + aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"], + builder: ["kind", "key", "params", "body", "computed", "static", "generator", "async"], + visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], + fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, { + body: { + validate: (0, _utils.assertNodeType)("BlockStatement") + } + }) +}); +(0, _utils.default)("ObjectPattern", { + visitor: ["properties", "typeAnnotation", "decorators"], + builder: ["properties"], + aliases: ["Pattern", "PatternLike", "LVal"], + fields: Object.assign({}, patternLikeCommon, { + properties: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("RestElement", "ObjectProperty"))) + } + }) +}); +(0, _utils.default)("SpreadElement", { + visitor: ["argument"], + aliases: ["UnaryLike"], + deprecatedAlias: "SpreadProperty", + fields: { + argument: { + validate: (0, _utils.assertNodeType)("Expression") + } + } +}); +(0, _utils.default)("Super", { + aliases: ["Expression"] +}); +(0, _utils.default)("TaggedTemplateExpression", { + visitor: ["tag", "quasi"], + aliases: ["Expression"], + fields: { + tag: { + validate: (0, _utils.assertNodeType)("Expression") + }, + quasi: { + validate: (0, _utils.assertNodeType)("TemplateLiteral") + }, + typeParameters: { + validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), + optional: true + } + } +}); +(0, _utils.default)("TemplateElement", { + builder: ["value", "tail"], + fields: { + value: { + validate: (0, _utils.assertShape)({ + raw: { + validate: (0, _utils.assertValueType)("string") + }, + cooked: { + validate: (0, _utils.assertValueType)("string"), + optional: true + } + }) + }, + tail: { + default: false + } + } +}); +(0, _utils.default)("TemplateLiteral", { + visitor: ["quasis", "expressions"], + aliases: ["Expression", "Literal"], + fields: { + quasis: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TemplateElement"))) + }, + expressions: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "TSType")), function (node, key, val) { + if (node.quasis.length !== val.length + 1) { + throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of expressions.\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`); + } + }) + } + } +}); +(0, _utils.default)("YieldExpression", { + builder: ["argument", "delegate"], + visitor: ["argument"], + aliases: ["Expression", "Terminatorless"], + fields: { + delegate: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (val && !node.argument) { + throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument"); + } + }, { + type: "boolean" + })), + default: false + }, + argument: { + optional: true, + validate: (0, _utils.assertNodeType)("Expression") + } + } +}); +(0, _utils.default)("AwaitExpression", { + builder: ["argument"], + visitor: ["argument"], + aliases: ["Expression", "Terminatorless"], + fields: { + argument: { + validate: (0, _utils.assertNodeType)("Expression") + } + } +}); +(0, _utils.default)("Import", { + aliases: ["Expression"] +}); +(0, _utils.default)("BigIntLiteral", { + builder: ["value"], + fields: { + value: { + validate: (0, _utils.assertValueType)("string") + } + }, + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); +(0, _utils.default)("ExportNamespaceSpecifier", { + visitor: ["exported"], + aliases: ["ModuleSpecifier"], + fields: { + exported: { + validate: (0, _utils.assertNodeType)("Identifier") + } + } +}); +(0, _utils.default)("OptionalMemberExpression", { + builder: ["object", "property", "computed", "optional"], + visitor: ["object", "property"], + aliases: ["Expression"], + fields: { + object: { + validate: (0, _utils.assertNodeType)("Expression") + }, + property: { + validate: function () { + const normal = (0, _utils.assertNodeType)("Identifier"); + const computed = (0, _utils.assertNodeType)("Expression"); + + const validator = function (node, key, val) { + const validator = node.computed ? computed : normal; + validator(node, key, val); + }; + + validator.oneOfNodeTypes = ["Expression", "Identifier"]; + return validator; + }() + }, + computed: { + default: false + }, + optional: { + validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)()) + } + } +}); +(0, _utils.default)("OptionalCallExpression", { + visitor: ["callee", "arguments", "typeParameters", "typeArguments"], + builder: ["callee", "arguments", "optional"], + aliases: ["Expression"], + fields: { + callee: { + validate: (0, _utils.assertNodeType)("Expression") + }, + arguments: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName"))) + }, + optional: { + validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)()) + }, + typeArguments: { + validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), + optional: true + }, + typeParameters: { + validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), + optional: true + } + } +}); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/experimental.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/experimental.js similarity index 59% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/experimental.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/experimental.js index 3332a600733963..1a67e2446ef4e3 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/experimental.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/experimental.js @@ -2,31 +2,41 @@ var _utils = _interopRequireWildcard(require("./utils")); -var _es = require("./es2015"); +var _core = require("./core"); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } (0, _utils.default)("ArgumentPlaceholder", {}); -(0, _utils.default)("AwaitExpression", { - builder: ["argument"], - visitor: ["argument"], - aliases: ["Expression", "Terminatorless"], - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); (0, _utils.default)("BindExpression", { visitor: ["object", "callee"], aliases: ["Expression"], - fields: {} + fields: !process.env.BABEL_TYPES_8_BREAKING ? { + object: { + validate: Object.assign(() => {}, { + oneOfNodeTypes: ["Expression"] + }) + }, + callee: { + validate: Object.assign(() => {}, { + oneOfNodeTypes: ["Expression"] + }) + } + } : { + object: { + validate: (0, _utils.assertNodeType)("Expression") + }, + callee: { + validate: (0, _utils.assertNodeType)("Expression") + } + } }); (0, _utils.default)("ClassProperty", { visitor: ["key", "value", "typeAnnotation", "decorators"], - builder: ["key", "value", "typeAnnotation", "decorators", "computed"], + builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"], aliases: ["Property"], - fields: Object.assign({}, _es.classMethodOrPropertyCommon, { + fields: Object.assign({}, _core.classMethodOrPropertyCommon, { value: { validate: (0, _utils.assertNodeType)("Expression"), optional: true @@ -46,34 +56,12 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; readonly: { validate: (0, _utils.assertValueType)("boolean"), optional: true - } - }) -}); -(0, _utils.default)("OptionalMemberExpression", { - builder: ["object", "property", "computed", "optional"], - visitor: ["object", "property"], - aliases: ["Expression"], - fields: { - object: { - validate: (0, _utils.assertNodeType)("Expression") - }, - property: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier"); - const computed = (0, _utils.assertNodeType)("Expression"); - return function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - }() }, - computed: { - default: false - }, - optional: { - validate: (0, _utils.assertValueType)("boolean") + declare: { + validate: (0, _utils.assertValueType)("boolean"), + optional: true } - } + }) }); (0, _utils.default)("PipelineTopicExpression", { builder: ["expression"], @@ -96,33 +84,9 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; (0, _utils.default)("PipelinePrimaryTopicReference", { aliases: ["Expression"] }); -(0, _utils.default)("OptionalCallExpression", { - visitor: ["callee", "arguments", "typeParameters", "typeArguments"], - builder: ["callee", "arguments", "optional"], - aliases: ["Expression"], - fields: { - callee: { - validate: (0, _utils.assertNodeType)("Expression") - }, - arguments: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName"))) - }, - optional: { - validate: (0, _utils.assertValueType)("boolean") - }, - typeArguments: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), - optional: true - } - } -}); (0, _utils.default)("ClassPrivateProperty", { - visitor: ["key", "value"], - builder: ["key", "value"], + visitor: ["key", "value", "decorators"], + builder: ["key", "value", "decorators", "static"], aliases: ["Property", "Private"], fields: { key: { @@ -131,6 +95,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; value: { validate: (0, _utils.assertNodeType)("Expression"), optional: true + }, + decorators: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), + optional: true } } }); @@ -138,7 +106,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; builder: ["kind", "key", "params", "body", "static"], visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"], - fields: Object.assign({}, _es.classMethodOrDeclareMethodCommon, { + fields: Object.assign({}, _core.classMethodOrDeclareMethodCommon, _core.functionTypeAnnotationCommon, { key: { validate: (0, _utils.assertNodeType)("PrivateName") }, @@ -147,8 +115,16 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } }) }); -(0, _utils.default)("Import", { - aliases: ["Expression"] +(0, _utils.default)("ImportAttribute", { + visitor: ["key", "value"], + fields: { + key: { + validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral") + }, + value: { + validate: (0, _utils.assertNodeType)("StringLiteral") + } + } }); (0, _utils.default)("Decorator", { visitor: ["expression"], @@ -176,15 +152,6 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } } }); -(0, _utils.default)("ExportNamespaceSpecifier", { - visitor: ["exported"], - aliases: ["ModuleSpecifier"], - fields: { - exported: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); (0, _utils.default)("PrivateName", { visitor: ["id"], aliases: ["Private"], @@ -194,7 +161,26 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } } }); -(0, _utils.default)("BigIntLiteral", { +(0, _utils.default)("RecordExpression", { + visitor: ["properties"], + aliases: ["Expression"], + fields: { + properties: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectProperty", "SpreadElement"))) + } + } +}); +(0, _utils.default)("TupleExpression", { + fields: { + elements: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement"))), + default: [] + } + }, + visitor: ["elements"], + aliases: ["Expression"] +}); +(0, _utils.default)("DecimalLiteral", { builder: ["value"], fields: { value: { @@ -202,4 +188,13 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } }, aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); +(0, _utils.default)("StaticBlock", { + visitor: ["body"], + fields: { + body: { + validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) + } + }, + aliases: ["Scopable", "BlockParent"] }); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/flow.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/flow.js similarity index 82% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/flow.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/flow.js index 07db5e38323cf5..a6d74d7aa4c9a9 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/flow.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/flow.js @@ -2,7 +2,9 @@ var _utils = _interopRequireWildcard(require("./utils")); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => { (0, _utils.default)(name, { @@ -302,6 +304,9 @@ defineInterfaceishType("InterfaceDeclaration"); (0, _utils.default)("StringTypeAnnotation", { aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] }); +(0, _utils.default)("SymbolTypeAnnotation", { + aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] +}); (0, _utils.default)("ThisTypeAnnotation", { aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] }); @@ -383,4 +388,74 @@ defineInterfaceishType("InterfaceDeclaration"); }); (0, _utils.default)("VoidTypeAnnotation", { aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] +}); +(0, _utils.default)("EnumDeclaration", { + aliases: ["Statement", "Declaration"], + visitor: ["id", "body"], + fields: { + id: (0, _utils.validateType)("Identifier"), + body: (0, _utils.validateType)(["EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody"]) + } +}); +(0, _utils.default)("EnumBooleanBody", { + aliases: ["EnumBody"], + visitor: ["members"], + fields: { + explicit: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), + members: (0, _utils.validateArrayOfType)("EnumBooleanMember") + } +}); +(0, _utils.default)("EnumNumberBody", { + aliases: ["EnumBody"], + visitor: ["members"], + fields: { + explicit: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), + members: (0, _utils.validateArrayOfType)("EnumNumberMember") + } +}); +(0, _utils.default)("EnumStringBody", { + aliases: ["EnumBody"], + visitor: ["members"], + fields: { + explicit: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), + members: (0, _utils.validateArrayOfType)(["EnumStringMember", "EnumDefaultedMember"]) + } +}); +(0, _utils.default)("EnumSymbolBody", { + aliases: ["EnumBody"], + visitor: ["members"], + fields: { + members: (0, _utils.validateArrayOfType)("EnumDefaultedMember") + } +}); +(0, _utils.default)("EnumBooleanMember", { + aliases: ["EnumMember"], + visitor: ["id"], + fields: { + id: (0, _utils.validateType)("Identifier"), + init: (0, _utils.validateType)("BooleanLiteral") + } +}); +(0, _utils.default)("EnumNumberMember", { + aliases: ["EnumMember"], + visitor: ["id", "init"], + fields: { + id: (0, _utils.validateType)("Identifier"), + init: (0, _utils.validateType)("NumericLiteral") + } +}); +(0, _utils.default)("EnumStringMember", { + aliases: ["EnumMember"], + visitor: ["id", "init"], + fields: { + id: (0, _utils.validateType)("Identifier"), + init: (0, _utils.validateType)("StringLiteral") + } +}); +(0, _utils.default)("EnumDefaultedMember", { + aliases: ["EnumMember"], + visitor: ["id"], + fields: { + id: (0, _utils.validateType)("Identifier") + } }); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/index.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/index.js similarity index 72% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/index.js index 7f28569f508e8f..d69997f29319d7 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/index.js @@ -39,6 +39,12 @@ Object.defineProperty(exports, "DEPRECATED_KEYS", { return _utils.DEPRECATED_KEYS; } }); +Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", { + enumerable: true, + get: function () { + return _utils.NODE_PARENT_VALIDATIONS; + } +}); Object.defineProperty(exports, "PLACEHOLDERS", { enumerable: true, get: function () { @@ -59,20 +65,10 @@ Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", { }); exports.TYPES = void 0; -function _toFastProperties() { - const data = _interopRequireDefault(require("to-fast-properties")); - - _toFastProperties = function () { - return data; - }; - - return data; -} +var _toFastProperties = _interopRequireDefault(require("to-fast-properties")); require("./core"); -require("./es2015"); - require("./flow"); require("./jsx"); @@ -89,13 +85,13 @@ var _placeholders = require("./placeholders"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -(0, _toFastProperties().default)(_utils.VISITOR_KEYS); -(0, _toFastProperties().default)(_utils.ALIAS_KEYS); -(0, _toFastProperties().default)(_utils.FLIPPED_ALIAS_KEYS); -(0, _toFastProperties().default)(_utils.NODE_FIELDS); -(0, _toFastProperties().default)(_utils.BUILDER_KEYS); -(0, _toFastProperties().default)(_utils.DEPRECATED_KEYS); -(0, _toFastProperties().default)(_placeholders.PLACEHOLDERS_ALIAS); -(0, _toFastProperties().default)(_placeholders.PLACEHOLDERS_FLIPPED_ALIAS); +(0, _toFastProperties.default)(_utils.VISITOR_KEYS); +(0, _toFastProperties.default)(_utils.ALIAS_KEYS); +(0, _toFastProperties.default)(_utils.FLIPPED_ALIAS_KEYS); +(0, _toFastProperties.default)(_utils.NODE_FIELDS); +(0, _toFastProperties.default)(_utils.BUILDER_KEYS); +(0, _toFastProperties.default)(_utils.DEPRECATED_KEYS); +(0, _toFastProperties.default)(_placeholders.PLACEHOLDERS_ALIAS); +(0, _toFastProperties.default)(_placeholders.PLACEHOLDERS_FLIPPED_ALIAS); const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS)); exports.TYPES = TYPES; \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/jsx.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/jsx.js similarity index 80% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/jsx.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/jsx.js index 60d37e98ca16ee..cdea06ba39593a 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/jsx.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/jsx.js @@ -2,7 +2,9 @@ var _utils = _interopRequireWildcard(require("./utils")); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } (0, _utils.default)("JSXAttribute", { visitor: ["name", "value"], @@ -22,7 +24,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; aliases: ["JSX", "Immutable"], fields: { name: { - validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression") + validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName") } } }); @@ -40,6 +42,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; }, children: { validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment"))) + }, + selfClosing: { + validate: (0, _utils.assertValueType)("boolean"), + optional: true } } }); @@ -103,11 +109,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; aliases: ["JSX", "Immutable"], fields: { name: { - validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression") + validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName") }, selfClosing: { - default: false, - validate: (0, _utils.assertValueType)("boolean") + default: false }, attributes: { validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXAttribute", "JSXSpreadAttribute"))) diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/misc.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/misc.js new file mode 100644 index 00000000000000..f72c651151f7cb --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/misc.js @@ -0,0 +1,33 @@ +"use strict"; + +var _utils = _interopRequireWildcard(require("./utils")); + +var _placeholders = require("./placeholders"); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +(0, _utils.default)("Noop", { + visitor: [] +}); +(0, _utils.default)("Placeholder", { + visitor: [], + builder: ["expectedNode", "name"], + fields: { + name: { + validate: (0, _utils.assertNodeType)("Identifier") + }, + expectedNode: { + validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS) + } + } +}); +(0, _utils.default)("V8IntrinsicIdentifier", { + builder: ["name"], + fields: { + name: { + validate: (0, _utils.assertValueType)("string") + } + } +}); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/placeholders.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/placeholders.js similarity index 92% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/placeholders.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/placeholders.js index 0edf7b2e80955c..52b52e5e80b14e 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/placeholders.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/placeholders.js @@ -17,7 +17,7 @@ exports.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS; for (const type of PLACEHOLDERS) { const alias = _utils.ALIAS_KEYS[type]; - if (alias && alias.length) PLACEHOLDERS_ALIAS[type] = alias; + if (alias == null ? void 0 : alias.length) PLACEHOLDERS_ALIAS[type] = alias; } const PLACEHOLDERS_FLIPPED_ALIAS = {}; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/typescript.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/typescript.js similarity index 84% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/typescript.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/typescript.js index 4d9be114a5d88c..c8d1dc53949515 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/typescript.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/typescript.js @@ -4,9 +4,9 @@ var _utils = _interopRequireWildcard(require("./utils")); var _core = require("./core"); -var _es = require("./es2015"); +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } const bool = (0, _utils.assertValueType)("boolean"); const tSFunctionTypeAnnotationCommon = { @@ -43,7 +43,7 @@ const tSFunctionTypeAnnotationCommon = { }); (0, _utils.default)("TSDeclareMethod", { visitor: ["decorators", "key", "typeParameters", "params", "returnType"], - fields: Object.assign({}, _es.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon) + fields: Object.assign({}, _core.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon) }); (0, _utils.default)("TSQualifiedName", { aliases: ["TSEntityName"], @@ -93,18 +93,18 @@ const namedTypeElementCommon = { typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation") } }); -const tsKeywordTypes = ["TSAnyKeyword", "TSUnknownKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSBooleanKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSVoidKeyword", "TSUndefinedKeyword", "TSNullKeyword", "TSNeverKeyword"]; +const tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSIntrinsicKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"]; for (const type of tsKeywordTypes) { (0, _utils.default)(type, { - aliases: ["TSType"], + aliases: ["TSType", "TSBaseType"], visitor: [], fields: {} }); } (0, _utils.default)("TSThisType", { - aliases: ["TSType"], + aliases: ["TSType", "TSBaseType"], visitor: [], fields: {} }); @@ -126,9 +126,11 @@ const fnOrCtr = { (0, _utils.default)("TSTypePredicate", { aliases: ["TSType"], visitor: ["parameterName", "typeAnnotation"], + builder: ["parameterName", "typeAnnotation", "asserts"], fields: { parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]), - typeAnnotation: (0, _utils.validateType)("TSTypeAnnotation") + typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"), + asserts: (0, _utils.validateOptional)(bool) } }); (0, _utils.default)("TSTypeQuery", { @@ -156,7 +158,7 @@ const fnOrCtr = { aliases: ["TSType"], visitor: ["elementTypes"], fields: { - elementTypes: (0, _utils.validateArrayOfType)("TSType") + elementTypes: (0, _utils.validateArrayOfType)(["TSType", "TSNamedTupleMember"]) } }); (0, _utils.default)("TSOptionalType", { @@ -173,6 +175,18 @@ const fnOrCtr = { typeAnnotation: (0, _utils.validateType)("TSType") } }); +(0, _utils.default)("TSNamedTupleMember", { + visitor: ["label", "elementType"], + builder: ["label", "elementType", "optional"], + fields: { + label: (0, _utils.validateType)("Identifier"), + optional: { + validate: bool, + default: false + }, + elementType: (0, _utils.validateType)("TSType") + } +}); const unionOrIntersection = { aliases: ["TSType"], visitor: ["types"], @@ -224,19 +238,20 @@ const unionOrIntersection = { }); (0, _utils.default)("TSMappedType", { aliases: ["TSType"], - visitor: ["typeParameter", "typeAnnotation"], + visitor: ["typeParameter", "typeAnnotation", "nameType"], fields: { readonly: (0, _utils.validateOptional)(bool), typeParameter: (0, _utils.validateType)("TSTypeParameter"), optional: (0, _utils.validateOptional)(bool), - typeAnnotation: (0, _utils.validateOptionalType)("TSType") + typeAnnotation: (0, _utils.validateOptionalType)("TSType"), + nameType: (0, _utils.validateOptionalType)("TSType") } }); (0, _utils.default)("TSLiteralType", { - aliases: ["TSType"], + aliases: ["TSType", "TSBaseType"], visitor: ["literal"], fields: { - literal: (0, _utils.validateType)(["NumericLiteral", "StringLiteral", "BooleanLiteral"]) + literal: (0, _utils.validateType)(["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral"]) } }); (0, _utils.default)("TSExpressionWithTypeArguments", { @@ -395,6 +410,7 @@ const unionOrIntersection = { } }); (0, _utils.default)("TSTypeParameter", { + builder: ["constraint", "default", "name"], visitor: ["constraint", "default"], fields: { name: { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/utils.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/utils.js similarity index 65% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/utils.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/utils.js index 95ba9740c49588..447142642b7d5b 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/utils.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/definitions/utils.js @@ -17,9 +17,10 @@ exports.assertNodeType = assertNodeType; exports.assertNodeOrValueType = assertNodeOrValueType; exports.assertValueType = assertValueType; exports.assertShape = assertShape; +exports.assertOptionalChainStart = assertOptionalChainStart; exports.chain = chain; exports.default = defineType; -exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.FLIPPED_ALIAS_KEYS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = void 0; +exports.NODE_PARENT_VALIDATIONS = exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.FLIPPED_ALIAS_KEYS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = void 0; var _is = _interopRequireDefault(require("../validators/is")); @@ -39,14 +40,14 @@ const BUILDER_KEYS = {}; exports.BUILDER_KEYS = BUILDER_KEYS; const DEPRECATED_KEYS = {}; exports.DEPRECATED_KEYS = DEPRECATED_KEYS; +const NODE_PARENT_VALIDATIONS = {}; +exports.NODE_PARENT_VALIDATIONS = NODE_PARENT_VALIDATIONS; function getType(val) { if (Array.isArray(val)) { return "array"; } else if (val === null) { return "null"; - } else if (val === undefined) { - return "undefined"; } else { return typeof val; } @@ -97,7 +98,10 @@ function assertEach(callback) { if (!Array.isArray(val)) return; for (let i = 0; i < val.length; i++) { - callback(node, `${key}[${i}]`, val[i]); + const subkey = `${key}[${i}]`; + const v = val[i]; + callback(node, subkey, v); + if (process.env.BABEL_TYPES_8_BREAKING) (0, _validate.validateChild)(node, subkey, v); } } @@ -118,18 +122,14 @@ function assertOneOf(...values) { function assertNodeType(...types) { function validate(node, key, val) { - let valid = false; - for (const type of types) { if ((0, _is.default)(type, val)) { - valid = true; - break; + (0, _validate.validateChild)(node, key, val); + return; } } - if (!valid) { - throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} ` + `but instead got ${JSON.stringify(val && val.type)}`); - } + throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`); } validate.oneOfNodeTypes = types; @@ -138,18 +138,14 @@ function assertNodeType(...types) { function assertNodeOrValueType(...types) { function validate(node, key, val) { - let valid = false; - for (const type of types) { if (getType(val) === type || (0, _is.default)(type, val)) { - valid = true; - break; + (0, _validate.validateChild)(node, key, val); + return; } } - if (!valid) { - throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} ` + `but instead got ${JSON.stringify(val && val.type)}`); - } + throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`); } validate.oneOfNodeOrValueTypes = types; @@ -195,6 +191,38 @@ function assertShape(shape) { return validate; } +function assertOptionalChainStart() { + function validate(node) { + var _current; + + let current = node; + + while (node) { + const { + type + } = current; + + if (type === "OptionalCallExpression") { + if (current.optional) return; + current = current.callee; + continue; + } + + if (type === "OptionalMemberExpression") { + if (current.optional) return; + current = current.object; + continue; + } + + break; + } + + throw new TypeError(`Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(_current = current) == null ? void 0 : _current.type}`); + } + + return validate; +} + function chain(...fns) { function validate(...args) { for (const fn of fns) { @@ -206,13 +234,40 @@ function chain(...fns) { return validate; } +const validTypeOpts = ["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"]; +const validFieldKeys = ["default", "optional", "validate"]; + function defineType(type, opts = {}) { const inherits = opts.inherits && store[opts.inherits] || {}; - const fields = opts.fields || inherits.fields || {}; + let fields = opts.fields; + + if (!fields) { + fields = {}; + + if (inherits.fields) { + const keys = Object.getOwnPropertyNames(inherits.fields); + + for (const key of keys) { + const field = inherits.fields[key]; + fields[key] = { + default: field.default, + optional: field.optional, + validate: field.validate + }; + } + } + } + const visitor = opts.visitor || inherits.visitor || []; const aliases = opts.aliases || inherits.aliases || []; const builder = opts.builder || inherits.builder || opts.visitor || []; + for (const k of Object.keys(opts)) { + if (validTypeOpts.indexOf(k) === -1) { + throw new Error(`Unknown type option "${k}" on ${type}`); + } + } + if (opts.deprecatedAlias) { DEPRECATED_KEYS[opts.deprecatedAlias] = type; } @@ -224,15 +279,21 @@ function defineType(type, opts = {}) { for (const key of Object.keys(fields)) { const field = fields[key]; - if (builder.indexOf(key) === -1) { + if (field.default !== undefined && builder.indexOf(key) === -1) { field.optional = true; } if (field.default === undefined) { field.default = null; - } else if (!field.validate) { + } else if (!field.validate && field.default != null) { field.validate = assertValueType(getType(field.default)); } + + for (const k of Object.keys(field)) { + if (validFieldKeys.indexOf(k) === -1) { + throw new Error(`Unknown field key "${k}" on ${type}.${key}`); + } + } } VISITOR_KEYS[type] = opts.visitor = visitor; @@ -243,6 +304,11 @@ function defineType(type, opts = {}) { FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || []; FLIPPED_ALIAS_KEYS[alias].push(type); }); + + if (opts.validate) { + NODE_PARENT_VALIDATIONS[type] = opts.validate; + } + store[type] = opts; } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/index.js similarity index 92% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/index.js index f5bb66b0aaa149..2801bc6882885a 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/index.js @@ -8,9 +8,12 @@ var _exportNames = { assertNode: true, createTypeAnnotationBasedOnTypeof: true, createUnionTypeAnnotation: true, + createFlowUnionType: true, + createTSUnionType: true, cloneNode: true, clone: true, cloneDeep: true, + cloneDeepWithoutLoc: true, cloneWithoutLoc: true, addComment: true, addComments: true, @@ -74,7 +77,19 @@ Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", { Object.defineProperty(exports, "createUnionTypeAnnotation", { enumerable: true, get: function () { - return _createUnionTypeAnnotation.default; + return _createFlowUnionType.default; + } +}); +Object.defineProperty(exports, "createFlowUnionType", { + enumerable: true, + get: function () { + return _createFlowUnionType.default; + } +}); +Object.defineProperty(exports, "createTSUnionType", { + enumerable: true, + get: function () { + return _createTSUnionType.default; } }); Object.defineProperty(exports, "cloneNode", { @@ -95,6 +110,12 @@ Object.defineProperty(exports, "cloneDeep", { return _cloneDeep.default; } }); +Object.defineProperty(exports, "cloneDeepWithoutLoc", { + enumerable: true, + get: function () { + return _cloneDeepWithoutLoc.default; + } +}); Object.defineProperty(exports, "cloneWithoutLoc", { enumerable: true, get: function () { @@ -392,6 +413,7 @@ var _generated = require("./asserts/generated"); Object.keys(_generated).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _generated[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -402,13 +424,16 @@ Object.keys(_generated).forEach(function (key) { var _createTypeAnnotationBasedOnTypeof = _interopRequireDefault(require("./builders/flow/createTypeAnnotationBasedOnTypeof")); -var _createUnionTypeAnnotation = _interopRequireDefault(require("./builders/flow/createUnionTypeAnnotation")); +var _createFlowUnionType = _interopRequireDefault(require("./builders/flow/createFlowUnionType")); + +var _createTSUnionType = _interopRequireDefault(require("./builders/typescript/createTSUnionType")); var _generated2 = require("./builders/generated"); Object.keys(_generated2).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _generated2[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -423,6 +448,8 @@ var _clone = _interopRequireDefault(require("./clone/clone")); var _cloneDeep = _interopRequireDefault(require("./clone/cloneDeep")); +var _cloneDeepWithoutLoc = _interopRequireDefault(require("./clone/cloneDeepWithoutLoc")); + var _cloneWithoutLoc = _interopRequireDefault(require("./clone/cloneWithoutLoc")); var _addComment = _interopRequireDefault(require("./comments/addComment")); @@ -444,6 +471,7 @@ var _generated3 = require("./constants/generated"); Object.keys(_generated3).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _generated3[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -457,6 +485,7 @@ var _constants = require("./constants"); Object.keys(_constants).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _constants[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -490,6 +519,7 @@ var _definitions = require("./definitions"); Object.keys(_definitions).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _definitions[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -561,6 +591,7 @@ var _generated4 = require("./validators/generated"); Object.keys(_generated4).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _generated4[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js.flow b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/index.js.flow similarity index 69% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js.flow rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/index.js.flow index c7e80a15fdb1a2..aaebaa6ef52efb 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/index.js.flow +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/index.js.flow @@ -35,6 +35,7 @@ declare class BabelNode { start: ?number; end: ?number; loc: ?BabelNodeSourceLocation; + extra?: { [string]: mixed }; } declare class BabelNodeArrayExpression extends BabelNode { @@ -52,7 +53,7 @@ declare class BabelNodeAssignmentExpression extends BabelNode { declare class BabelNodeBinaryExpression extends BabelNode { type: "BinaryExpression"; operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<="; - left: BabelNodeExpression; + left: BabelNodeExpression | BabelNodePrivateName; right: BabelNodeExpression; } @@ -84,7 +85,7 @@ declare class BabelNodeBreakStatement extends BabelNode { declare class BabelNodeCallExpression extends BabelNode { type: "CallExpression"; - callee: BabelNodeExpression; + callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier; arguments: Array; optional?: true | false; typeArguments?: BabelNodeTypeParameterInstantiation; @@ -93,7 +94,7 @@ declare class BabelNodeCallExpression extends BabelNode { declare class BabelNodeCatchClause extends BabelNode { type: "CatchClause"; - param?: BabelNodeIdentifier; + param?: BabelNodeIdentifier | BabelNodeArrayPattern | BabelNodeObjectPattern; body: BabelNodeBlockStatement; } @@ -131,8 +132,8 @@ declare class BabelNodeExpressionStatement extends BabelNode { declare class BabelNodeFile extends BabelNode { type: "File"; program: BabelNodeProgram; - comments: any; - tokens: any; + comments?: Array; + tokens?: Array; } declare class BabelNodeForInStatement extends BabelNode { @@ -229,14 +230,14 @@ declare class BabelNodeLogicalExpression extends BabelNode { declare class BabelNodeMemberExpression extends BabelNode { type: "MemberExpression"; object: BabelNodeExpression; - property: any; + property: BabelNodeExpression | BabelNodeIdentifier | BabelNodePrivateName; computed?: boolean; optional?: true | false; } declare class BabelNodeNewExpression extends BabelNode { type: "NewExpression"; - callee: BabelNodeExpression; + callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier; arguments: Array; optional?: true | false; typeArguments?: BabelNodeTypeParameterInstantiation; @@ -249,7 +250,7 @@ declare class BabelNodeProgram extends BabelNode { directives?: Array; sourceType?: "script" | "module"; interpreter?: BabelNodeInterpreterDirective; - sourceFile?: string; + sourceFile: string; } declare class BabelNodeObjectExpression extends BabelNode { @@ -260,20 +261,20 @@ declare class BabelNodeObjectExpression extends BabelNode { declare class BabelNodeObjectMethod extends BabelNode { type: "ObjectMethod"; kind?: "method" | "get" | "set"; - key: any; + key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral; params: Array; body: BabelNodeBlockStatement; computed?: boolean; + generator?: boolean; async?: boolean; decorators?: Array; - generator?: boolean; returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; } declare class BabelNodeObjectProperty extends BabelNode { type: "ObjectProperty"; - key: any; + key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral; value: BabelNodeExpression | BabelNodePatternLike; computed?: boolean; shorthand?: boolean; @@ -361,13 +362,13 @@ declare class BabelNodeVariableDeclarator extends BabelNode { declare class BabelNodeWhileStatement extends BabelNode { type: "WhileStatement"; test: BabelNodeExpression; - body: BabelNodeBlockStatement | BabelNodeStatement; + body: BabelNodeStatement; } declare class BabelNodeWithStatement extends BabelNode { type: "WithStatement"; object: BabelNodeExpression; - body: BabelNodeBlockStatement | BabelNodeStatement; + body: BabelNodeStatement; } declare class BabelNodeAssignmentPattern extends BabelNode { @@ -380,7 +381,7 @@ declare class BabelNodeAssignmentPattern extends BabelNode { declare class BabelNodeArrayPattern extends BabelNode { type: "ArrayPattern"; - elements: Array; + elements: Array; decorators?: Array; typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; } @@ -390,7 +391,7 @@ declare class BabelNodeArrowFunctionExpression extends BabelNode { params: Array; body: BabelNodeBlockStatement | BabelNodeExpression; async?: boolean; - expression?: boolean; + expression: boolean; generator?: boolean; returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; @@ -401,26 +402,26 @@ declare class BabelNodeClassBody extends BabelNode { body: Array; } -declare class BabelNodeClassDeclaration extends BabelNode { - type: "ClassDeclaration"; +declare class BabelNodeClassExpression extends BabelNode { + type: "ClassExpression"; id?: BabelNodeIdentifier; superClass?: BabelNodeExpression; body: BabelNodeClassBody; decorators?: Array; - abstract?: boolean; - declare?: boolean; - mixins?: any; + mixins?: BabelNodeInterfaceExtends; superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation; typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; } -declare class BabelNodeClassExpression extends BabelNode { - type: "ClassExpression"; - id?: BabelNodeIdentifier; +declare class BabelNodeClassDeclaration extends BabelNode { + type: "ClassDeclaration"; + id: BabelNodeIdentifier; superClass?: BabelNodeExpression; body: BabelNodeClassBody; decorators?: Array; - mixins?: any; + abstract?: boolean; + declare?: boolean; + mixins?: BabelNodeInterfaceExtends; superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation; typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; } @@ -428,6 +429,7 @@ declare class BabelNodeClassExpression extends BabelNode { declare class BabelNodeExportAllDeclaration extends BabelNode { type: "ExportAllDeclaration"; source: BabelNodeStringLiteral; + assertions?: BabelNodeImportAttribute; } declare class BabelNodeExportDefaultDeclaration extends BabelNode { @@ -438,15 +440,16 @@ declare class BabelNodeExportDefaultDeclaration extends BabelNode { declare class BabelNodeExportNamedDeclaration extends BabelNode { type: "ExportNamedDeclaration"; declaration?: BabelNodeDeclaration; - specifiers: Array; + specifiers?: Array; source?: BabelNodeStringLiteral; + assertions?: BabelNodeImportAttribute; exportKind?: "type" | "value"; } declare class BabelNodeExportSpecifier extends BabelNode { type: "ExportSpecifier"; local: BabelNodeIdentifier; - exported: BabelNodeIdentifier; + exported: BabelNodeIdentifier | BabelNodeStringLiteral; } declare class BabelNodeForOfStatement extends BabelNode { @@ -460,6 +463,7 @@ declare class BabelNodeImportDeclaration extends BabelNode { type: "ImportDeclaration"; specifiers: Array; source: BabelNodeStringLiteral; + assertions?: BabelNodeImportAttribute; importKind?: "type" | "typeof" | "value"; } @@ -476,7 +480,7 @@ declare class BabelNodeImportNamespaceSpecifier extends BabelNode { declare class BabelNodeImportSpecifier extends BabelNode { type: "ImportSpecifier"; local: BabelNodeIdentifier; - imported: BabelNodeIdentifier; + imported: BabelNodeIdentifier | BabelNodeStringLiteral; importKind?: "type" | "typeof"; } @@ -493,12 +497,12 @@ declare class BabelNodeClassMethod extends BabelNode { params: Array; body: BabelNodeBlockStatement; computed?: boolean; + generator?: boolean; + async?: boolean; abstract?: boolean; access?: "public" | "private" | "protected"; accessibility?: "public" | "private" | "protected"; - async?: boolean; decorators?: Array; - generator?: boolean; optional?: boolean; returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; @@ -536,7 +540,7 @@ declare class BabelNodeTemplateElement extends BabelNode { declare class BabelNodeTemplateLiteral extends BabelNode { type: "TemplateLiteral"; quasis: Array; - expressions: Array; + expressions: Array; } declare class BabelNodeYieldExpression extends BabelNode { @@ -545,6 +549,42 @@ declare class BabelNodeYieldExpression extends BabelNode { delegate?: boolean; } +declare class BabelNodeAwaitExpression extends BabelNode { + type: "AwaitExpression"; + argument: BabelNodeExpression; +} + +declare class BabelNodeImport extends BabelNode { + type: "Import"; +} + +declare class BabelNodeBigIntLiteral extends BabelNode { + type: "BigIntLiteral"; + value: string; +} + +declare class BabelNodeExportNamespaceSpecifier extends BabelNode { + type: "ExportNamespaceSpecifier"; + exported: BabelNodeIdentifier; +} + +declare class BabelNodeOptionalMemberExpression extends BabelNode { + type: "OptionalMemberExpression"; + object: BabelNodeExpression; + property: BabelNodeExpression | BabelNodeIdentifier; + computed?: boolean; + optional: boolean; +} + +declare class BabelNodeOptionalCallExpression extends BabelNode { + type: "OptionalCallExpression"; + callee: BabelNodeExpression; + arguments: Array; + optional: boolean; + typeArguments?: BabelNodeTypeParameterInstantiation; + typeParameters?: BabelNodeTSTypeParameterInstantiation; +} + declare class BabelNodeAnyTypeAnnotation extends BabelNode { type: "AnyTypeAnnotation"; } @@ -755,9 +795,9 @@ declare class BabelNodeObjectTypeProperty extends BabelNode { key: BabelNodeIdentifier | BabelNodeStringLiteral; value: BabelNodeFlowType; variance?: BabelNodeVariance; - kind?: "init" | "get" | "set"; - optional?: boolean; - proto?: boolean; + kind: "init" | "get" | "set"; + optional: boolean; + proto: boolean; } declare class BabelNodeObjectTypeSpreadProperty extends BabelNode { @@ -788,6 +828,10 @@ declare class BabelNodeStringTypeAnnotation extends BabelNode { type: "StringTypeAnnotation"; } +declare class BabelNodeSymbolTypeAnnotation extends BabelNode { + type: "SymbolTypeAnnotation"; +} + declare class BabelNodeThisTypeAnnotation extends BabelNode { type: "ThisTypeAnnotation"; } @@ -824,7 +868,7 @@ declare class BabelNodeTypeParameter extends BabelNode { type: "TypeParameter"; bound?: BabelNodeTypeAnnotation; variance?: BabelNodeVariance; - name?: string; + name: string; } declare class BabelNodeTypeParameterDeclaration extends BabelNode { @@ -851,6 +895,58 @@ declare class BabelNodeVoidTypeAnnotation extends BabelNode { type: "VoidTypeAnnotation"; } +declare class BabelNodeEnumDeclaration extends BabelNode { + type: "EnumDeclaration"; + id: BabelNodeIdentifier; + body: BabelNodeEnumBooleanBody | BabelNodeEnumNumberBody | BabelNodeEnumStringBody | BabelNodeEnumSymbolBody; +} + +declare class BabelNodeEnumBooleanBody extends BabelNode { + type: "EnumBooleanBody"; + members: Array; + explicit: boolean; +} + +declare class BabelNodeEnumNumberBody extends BabelNode { + type: "EnumNumberBody"; + members: Array; + explicit: boolean; +} + +declare class BabelNodeEnumStringBody extends BabelNode { + type: "EnumStringBody"; + members: Array; + explicit: boolean; +} + +declare class BabelNodeEnumSymbolBody extends BabelNode { + type: "EnumSymbolBody"; + members: Array; +} + +declare class BabelNodeEnumBooleanMember extends BabelNode { + type: "EnumBooleanMember"; + id: BabelNodeIdentifier; + init: BabelNodeBooleanLiteral; +} + +declare class BabelNodeEnumNumberMember extends BabelNode { + type: "EnumNumberMember"; + id: BabelNodeIdentifier; + init: BabelNodeNumericLiteral; +} + +declare class BabelNodeEnumStringMember extends BabelNode { + type: "EnumStringMember"; + id: BabelNodeIdentifier; + init: BabelNodeStringLiteral; +} + +declare class BabelNodeEnumDefaultedMember extends BabelNode { + type: "EnumDefaultedMember"; + id: BabelNodeIdentifier; +} + declare class BabelNodeJSXAttribute extends BabelNode { type: "JSXAttribute"; name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName; @@ -859,7 +955,7 @@ declare class BabelNodeJSXAttribute extends BabelNode { declare class BabelNodeJSXClosingElement extends BabelNode { type: "JSXClosingElement"; - name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression; + name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName; } declare class BabelNodeJSXElement extends BabelNode { @@ -867,7 +963,7 @@ declare class BabelNodeJSXElement extends BabelNode { openingElement: BabelNodeJSXOpeningElement; closingElement?: BabelNodeJSXClosingElement; children: Array; - selfClosing: any; + selfClosing?: boolean; } declare class BabelNodeJSXEmptyExpression extends BabelNode { @@ -903,7 +999,7 @@ declare class BabelNodeJSXNamespacedName extends BabelNode { declare class BabelNodeJSXOpeningElement extends BabelNode { type: "JSXOpeningElement"; - name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression; + name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName; attributes: Array; selfClosing?: boolean; typeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation; @@ -944,19 +1040,19 @@ declare class BabelNodePlaceholder extends BabelNode { name: BabelNodeIdentifier; } -declare class BabelNodeArgumentPlaceholder extends BabelNode { - type: "ArgumentPlaceholder"; +declare class BabelNodeV8IntrinsicIdentifier extends BabelNode { + type: "V8IntrinsicIdentifier"; + name: string; } -declare class BabelNodeAwaitExpression extends BabelNode { - type: "AwaitExpression"; - argument: BabelNodeExpression; +declare class BabelNodeArgumentPlaceholder extends BabelNode { + type: "ArgumentPlaceholder"; } declare class BabelNodeBindExpression extends BabelNode { type: "BindExpression"; - object: any; - callee: any; + object: BabelNodeExpression; + callee: BabelNodeExpression; } declare class BabelNodeClassProperty extends BabelNode { @@ -968,19 +1064,12 @@ declare class BabelNodeClassProperty extends BabelNode { computed?: boolean; abstract?: boolean; accessibility?: "public" | "private" | "protected"; + declare?: boolean; definite?: boolean; optional?: boolean; readonly?: boolean; } -declare class BabelNodeOptionalMemberExpression extends BabelNode { - type: "OptionalMemberExpression"; - object: BabelNodeExpression; - property: any; - computed?: boolean; - optional: boolean; -} - declare class BabelNodePipelineTopicExpression extends BabelNode { type: "PipelineTopicExpression"; expression: BabelNodeExpression; @@ -995,19 +1084,11 @@ declare class BabelNodePipelinePrimaryTopicReference extends BabelNode { type: "PipelinePrimaryTopicReference"; } -declare class BabelNodeOptionalCallExpression extends BabelNode { - type: "OptionalCallExpression"; - callee: BabelNodeExpression; - arguments: Array; - optional: boolean; - typeArguments?: BabelNodeTypeParameterInstantiation; - typeParameters?: BabelNodeTSTypeParameterInstantiation; -} - declare class BabelNodeClassPrivateProperty extends BabelNode { type: "ClassPrivateProperty"; key: BabelNodePrivateName; value?: BabelNodeExpression; + decorators?: Array; } declare class BabelNodeClassPrivateMethod extends BabelNode { @@ -1024,12 +1105,14 @@ declare class BabelNodeClassPrivateMethod extends BabelNode { decorators?: Array; generator?: boolean; optional?: boolean; - returnType?: any; - typeParameters?: any; + returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; + typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; } -declare class BabelNodeImport extends BabelNode { - type: "Import"; +declare class BabelNodeImportAttribute extends BabelNode { + type: "ImportAttribute"; + key: BabelNodeIdentifier | BabelNodeStringLiteral; + value: BabelNodeStringLiteral; } declare class BabelNodeDecorator extends BabelNode { @@ -1047,21 +1130,31 @@ declare class BabelNodeExportDefaultSpecifier extends BabelNode { exported: BabelNodeIdentifier; } -declare class BabelNodeExportNamespaceSpecifier extends BabelNode { - type: "ExportNamespaceSpecifier"; - exported: BabelNodeIdentifier; -} - declare class BabelNodePrivateName extends BabelNode { type: "PrivateName"; id: BabelNodeIdentifier; } -declare class BabelNodeBigIntLiteral extends BabelNode { - type: "BigIntLiteral"; +declare class BabelNodeRecordExpression extends BabelNode { + type: "RecordExpression"; + properties: Array; +} + +declare class BabelNodeTupleExpression extends BabelNode { + type: "TupleExpression"; + elements?: Array; +} + +declare class BabelNodeDecimalLiteral extends BabelNode { + type: "DecimalLiteral"; value: string; } +declare class BabelNodeStaticBlock extends BabelNode { + type: "StaticBlock"; + body: Array; +} + declare class BabelNodeTSParameterProperty extends BabelNode { type: "TSParameterProperty"; parameter: BabelNodeIdentifier | BabelNodeAssignmentPattern; @@ -1148,8 +1241,24 @@ declare class BabelNodeTSAnyKeyword extends BabelNode { type: "TSAnyKeyword"; } -declare class BabelNodeTSUnknownKeyword extends BabelNode { - type: "TSUnknownKeyword"; +declare class BabelNodeTSBooleanKeyword extends BabelNode { + type: "TSBooleanKeyword"; +} + +declare class BabelNodeTSBigIntKeyword extends BabelNode { + type: "TSBigIntKeyword"; +} + +declare class BabelNodeTSIntrinsicKeyword extends BabelNode { + type: "TSIntrinsicKeyword"; +} + +declare class BabelNodeTSNeverKeyword extends BabelNode { + type: "TSNeverKeyword"; +} + +declare class BabelNodeTSNullKeyword extends BabelNode { + type: "TSNullKeyword"; } declare class BabelNodeTSNumberKeyword extends BabelNode { @@ -1160,10 +1269,6 @@ declare class BabelNodeTSObjectKeyword extends BabelNode { type: "TSObjectKeyword"; } -declare class BabelNodeTSBooleanKeyword extends BabelNode { - type: "TSBooleanKeyword"; -} - declare class BabelNodeTSStringKeyword extends BabelNode { type: "TSStringKeyword"; } @@ -1172,20 +1277,16 @@ declare class BabelNodeTSSymbolKeyword extends BabelNode { type: "TSSymbolKeyword"; } -declare class BabelNodeTSVoidKeyword extends BabelNode { - type: "TSVoidKeyword"; -} - declare class BabelNodeTSUndefinedKeyword extends BabelNode { type: "TSUndefinedKeyword"; } -declare class BabelNodeTSNullKeyword extends BabelNode { - type: "TSNullKeyword"; +declare class BabelNodeTSUnknownKeyword extends BabelNode { + type: "TSUnknownKeyword"; } -declare class BabelNodeTSNeverKeyword extends BabelNode { - type: "TSNeverKeyword"; +declare class BabelNodeTSVoidKeyword extends BabelNode { + type: "TSVoidKeyword"; } declare class BabelNodeTSThisType extends BabelNode { @@ -1215,7 +1316,8 @@ declare class BabelNodeTSTypeReference extends BabelNode { declare class BabelNodeTSTypePredicate extends BabelNode { type: "TSTypePredicate"; parameterName: BabelNodeIdentifier | BabelNodeTSThisType; - typeAnnotation: BabelNodeTSTypeAnnotation; + typeAnnotation?: BabelNodeTSTypeAnnotation; + asserts?: boolean; } declare class BabelNodeTSTypeQuery extends BabelNode { @@ -1235,7 +1337,7 @@ declare class BabelNodeTSArrayType extends BabelNode { declare class BabelNodeTSTupleType extends BabelNode { type: "TSTupleType"; - elementTypes: Array; + elementTypes: Array; } declare class BabelNodeTSOptionalType extends BabelNode { @@ -1248,6 +1350,13 @@ declare class BabelNodeTSRestType extends BabelNode { typeAnnotation: BabelNodeTSType; } +declare class BabelNodeTSNamedTupleMember extends BabelNode { + type: "TSNamedTupleMember"; + label: BabelNodeIdentifier; + elementType: BabelNodeTSType; + optional?: boolean; +} + declare class BabelNodeTSUnionType extends BabelNode { type: "TSUnionType"; types: Array; @@ -1279,7 +1388,7 @@ declare class BabelNodeTSParenthesizedType extends BabelNode { declare class BabelNodeTSTypeOperator extends BabelNode { type: "TSTypeOperator"; typeAnnotation: BabelNodeTSType; - operator?: string; + operator: string; } declare class BabelNodeTSIndexedAccessType extends BabelNode { @@ -1292,13 +1401,14 @@ declare class BabelNodeTSMappedType extends BabelNode { type: "TSMappedType"; typeParameter: BabelNodeTSTypeParameter; typeAnnotation?: BabelNodeTSType; + nameType?: BabelNodeTSType; optional?: boolean; readonly?: boolean; } declare class BabelNodeTSLiteralType extends BabelNode { type: "TSLiteralType"; - literal: BabelNodeNumericLiteral | BabelNodeStringLiteral | BabelNodeBooleanLiteral; + literal: BabelNodeNumericLiteral | BabelNodeStringLiteral | BabelNodeBooleanLiteral | BabelNodeBigIntLiteral; } declare class BabelNodeTSExpressionWithTypeArguments extends BabelNode { @@ -1378,7 +1488,7 @@ declare class BabelNodeTSImportEqualsDeclaration extends BabelNode { type: "TSImportEqualsDeclaration"; id: BabelNodeIdentifier; moduleReference: BabelNodeTSEntityName | BabelNodeTSExternalModuleReference; - isExport?: boolean; + isExport: boolean; } declare class BabelNodeTSExternalModuleReference extends BabelNode { @@ -1419,15 +1529,15 @@ declare class BabelNodeTSTypeParameterDeclaration extends BabelNode { declare class BabelNodeTSTypeParameter extends BabelNode { type: "TSTypeParameter"; constraint?: BabelNodeTSType; - name?: string; + name: string; } -type BabelNodeExpression = BabelNodeArrayExpression | BabelNodeAssignmentExpression | BabelNodeBinaryExpression | BabelNodeCallExpression | BabelNodeConditionalExpression | BabelNodeFunctionExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeLogicalExpression | BabelNodeMemberExpression | BabelNodeNewExpression | BabelNodeObjectExpression | BabelNodeSequenceExpression | BabelNodeParenthesizedExpression | BabelNodeThisExpression | BabelNodeUnaryExpression | BabelNodeUpdateExpression | BabelNodeArrowFunctionExpression | BabelNodeClassExpression | BabelNodeMetaProperty | BabelNodeSuper | BabelNodeTaggedTemplateExpression | BabelNodeTemplateLiteral | BabelNodeYieldExpression | BabelNodeTypeCastExpression | BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeAwaitExpression | BabelNodeBindExpression | BabelNodeOptionalMemberExpression | BabelNodePipelinePrimaryTopicReference | BabelNodeOptionalCallExpression | BabelNodeImport | BabelNodeDoExpression | BabelNodeBigIntLiteral | BabelNodeTSAsExpression | BabelNodeTSTypeAssertion | BabelNodeTSNonNullExpression; +type BabelNodeExpression = BabelNodeArrayExpression | BabelNodeAssignmentExpression | BabelNodeBinaryExpression | BabelNodeCallExpression | BabelNodeConditionalExpression | BabelNodeFunctionExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeLogicalExpression | BabelNodeMemberExpression | BabelNodeNewExpression | BabelNodeObjectExpression | BabelNodeSequenceExpression | BabelNodeParenthesizedExpression | BabelNodeThisExpression | BabelNodeUnaryExpression | BabelNodeUpdateExpression | BabelNodeArrowFunctionExpression | BabelNodeClassExpression | BabelNodeMetaProperty | BabelNodeSuper | BabelNodeTaggedTemplateExpression | BabelNodeTemplateLiteral | BabelNodeYieldExpression | BabelNodeAwaitExpression | BabelNodeImport | BabelNodeBigIntLiteral | BabelNodeOptionalMemberExpression | BabelNodeOptionalCallExpression | BabelNodeTypeCastExpression | BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeBindExpression | BabelNodePipelinePrimaryTopicReference | BabelNodeDoExpression | BabelNodeRecordExpression | BabelNodeTupleExpression | BabelNodeDecimalLiteral | BabelNodeTSAsExpression | BabelNodeTSTypeAssertion | BabelNodeTSNonNullExpression; type BabelNodeBinary = BabelNodeBinaryExpression | BabelNodeLogicalExpression; -type BabelNodeScopable = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeClassDeclaration | BabelNodeClassExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeTSModuleBlock; -type BabelNodeBlockParent = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeTSModuleBlock; +type BabelNodeScopable = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeClassExpression | BabelNodeClassDeclaration | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeStaticBlock | BabelNodeTSModuleBlock; +type BabelNodeBlockParent = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeStaticBlock | BabelNodeTSModuleBlock; type BabelNodeBlock = BabelNodeBlockStatement | BabelNodeProgram | BabelNodeTSModuleBlock; -type BabelNodeStatement = BabelNodeBlockStatement | BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeDebuggerStatement | BabelNodeDoWhileStatement | BabelNodeEmptyStatement | BabelNodeExpressionStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeIfStatement | BabelNodeLabeledStatement | BabelNodeReturnStatement | BabelNodeSwitchStatement | BabelNodeThrowStatement | BabelNodeTryStatement | BabelNodeVariableDeclaration | BabelNodeWhileStatement | BabelNodeWithStatement | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeForOfStatement | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias | BabelNodeTSDeclareFunction | BabelNodeTSInterfaceDeclaration | BabelNodeTSTypeAliasDeclaration | BabelNodeTSEnumDeclaration | BabelNodeTSModuleDeclaration | BabelNodeTSImportEqualsDeclaration | BabelNodeTSExportAssignment | BabelNodeTSNamespaceExportDeclaration; +type BabelNodeStatement = BabelNodeBlockStatement | BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeDebuggerStatement | BabelNodeDoWhileStatement | BabelNodeEmptyStatement | BabelNodeExpressionStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeIfStatement | BabelNodeLabeledStatement | BabelNodeReturnStatement | BabelNodeSwitchStatement | BabelNodeThrowStatement | BabelNodeTryStatement | BabelNodeVariableDeclaration | BabelNodeWhileStatement | BabelNodeWithStatement | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeForOfStatement | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias | BabelNodeEnumDeclaration | BabelNodeTSDeclareFunction | BabelNodeTSInterfaceDeclaration | BabelNodeTSTypeAliasDeclaration | BabelNodeTSEnumDeclaration | BabelNodeTSModuleDeclaration | BabelNodeTSImportEqualsDeclaration | BabelNodeTSExportAssignment | BabelNodeTSNamespaceExportDeclaration; type BabelNodeTerminatorless = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement | BabelNodeYieldExpression | BabelNodeAwaitExpression; type BabelNodeCompletionStatement = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement; type BabelNodeConditional = BabelNodeConditionalExpression | BabelNodeIfStatement; @@ -1438,56 +1548,59 @@ type BabelNodeFor = BabelNodeForInStatement | BabelNodeForStatement | BabelNodeF type BabelNodeForXStatement = BabelNodeForInStatement | BabelNodeForOfStatement; type BabelNodeFunction = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod | BabelNodeClassPrivateMethod; type BabelNodeFunctionParent = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod | BabelNodeClassPrivateMethod; -type BabelNodePureish = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeArrowFunctionExpression | BabelNodeClassDeclaration | BabelNodeClassExpression | BabelNodeBigIntLiteral; -type BabelNodeDeclaration = BabelNodeFunctionDeclaration | BabelNodeVariableDeclaration | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias | BabelNodeTSDeclareFunction | BabelNodeTSInterfaceDeclaration | BabelNodeTSTypeAliasDeclaration | BabelNodeTSEnumDeclaration | BabelNodeTSModuleDeclaration; +type BabelNodePureish = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeArrowFunctionExpression | BabelNodeBigIntLiteral | BabelNodeDecimalLiteral; +type BabelNodeDeclaration = BabelNodeFunctionDeclaration | BabelNodeVariableDeclaration | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias | BabelNodeEnumDeclaration | BabelNodeTSDeclareFunction | BabelNodeTSInterfaceDeclaration | BabelNodeTSTypeAliasDeclaration | BabelNodeTSEnumDeclaration | BabelNodeTSModuleDeclaration; type BabelNodePatternLike = BabelNodeIdentifier | BabelNodeRestElement | BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern; type BabelNodeLVal = BabelNodeIdentifier | BabelNodeMemberExpression | BabelNodeRestElement | BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern | BabelNodeTSParameterProperty; type BabelNodeTSEntityName = BabelNodeIdentifier | BabelNodeTSQualifiedName; -type BabelNodeLiteral = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeTemplateLiteral | BabelNodeBigIntLiteral; -type BabelNodeImmutable = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXOpeningElement | BabelNodeJSXText | BabelNodeJSXFragment | BabelNodeJSXOpeningFragment | BabelNodeJSXClosingFragment | BabelNodeBigIntLiteral; +type BabelNodeLiteral = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeTemplateLiteral | BabelNodeBigIntLiteral | BabelNodeDecimalLiteral; +type BabelNodeImmutable = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeBigIntLiteral | BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXOpeningElement | BabelNodeJSXText | BabelNodeJSXFragment | BabelNodeJSXOpeningFragment | BabelNodeJSXClosingFragment | BabelNodeDecimalLiteral; type BabelNodeUserWhitespacable = BabelNodeObjectMethod | BabelNodeObjectProperty | BabelNodeObjectTypeInternalSlot | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty | BabelNodeObjectTypeSpreadProperty; type BabelNodeMethod = BabelNodeObjectMethod | BabelNodeClassMethod | BabelNodeClassPrivateMethod; type BabelNodeObjectMember = BabelNodeObjectMethod | BabelNodeObjectProperty; type BabelNodeProperty = BabelNodeObjectProperty | BabelNodeClassProperty | BabelNodeClassPrivateProperty; type BabelNodeUnaryLike = BabelNodeUnaryExpression | BabelNodeSpreadElement; type BabelNodePattern = BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern; -type BabelNodeClass = BabelNodeClassDeclaration | BabelNodeClassExpression; +type BabelNodeClass = BabelNodeClassExpression | BabelNodeClassDeclaration; type BabelNodeModuleDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration; type BabelNodeExportDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration; -type BabelNodeModuleSpecifier = BabelNodeExportSpecifier | BabelNodeImportDefaultSpecifier | BabelNodeImportNamespaceSpecifier | BabelNodeImportSpecifier | BabelNodeExportDefaultSpecifier | BabelNodeExportNamespaceSpecifier; -type BabelNodeFlow = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeClassImplements | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeDeclaredPredicate | BabelNodeExistsTypeAnnotation | BabelNodeFunctionTypeAnnotation | BabelNodeFunctionTypeParam | BabelNodeGenericTypeAnnotation | BabelNodeInferredPredicate | BabelNodeInterfaceExtends | BabelNodeInterfaceDeclaration | BabelNodeInterfaceTypeAnnotation | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumberLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeObjectTypeAnnotation | BabelNodeObjectTypeInternalSlot | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty | BabelNodeObjectTypeSpreadProperty | BabelNodeOpaqueType | BabelNodeQualifiedTypeIdentifier | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeTypeAlias | BabelNodeTypeAnnotation | BabelNodeTypeCastExpression | BabelNodeTypeParameter | BabelNodeTypeParameterDeclaration | BabelNodeTypeParameterInstantiation | BabelNodeUnionTypeAnnotation | BabelNodeVariance | BabelNodeVoidTypeAnnotation; -type BabelNodeFlowType = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeExistsTypeAnnotation | BabelNodeFunctionTypeAnnotation | BabelNodeGenericTypeAnnotation | BabelNodeInterfaceTypeAnnotation | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumberLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeObjectTypeAnnotation | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeUnionTypeAnnotation | BabelNodeVoidTypeAnnotation; -type BabelNodeFlowBaseAnnotation = BabelNodeAnyTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeVoidTypeAnnotation; +type BabelNodeModuleSpecifier = BabelNodeExportSpecifier | BabelNodeImportDefaultSpecifier | BabelNodeImportNamespaceSpecifier | BabelNodeImportSpecifier | BabelNodeExportNamespaceSpecifier | BabelNodeExportDefaultSpecifier; +type BabelNodeFlow = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeClassImplements | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeDeclaredPredicate | BabelNodeExistsTypeAnnotation | BabelNodeFunctionTypeAnnotation | BabelNodeFunctionTypeParam | BabelNodeGenericTypeAnnotation | BabelNodeInferredPredicate | BabelNodeInterfaceExtends | BabelNodeInterfaceDeclaration | BabelNodeInterfaceTypeAnnotation | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumberLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeObjectTypeAnnotation | BabelNodeObjectTypeInternalSlot | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty | BabelNodeObjectTypeSpreadProperty | BabelNodeOpaqueType | BabelNodeQualifiedTypeIdentifier | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeSymbolTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeTypeAlias | BabelNodeTypeAnnotation | BabelNodeTypeCastExpression | BabelNodeTypeParameter | BabelNodeTypeParameterDeclaration | BabelNodeTypeParameterInstantiation | BabelNodeUnionTypeAnnotation | BabelNodeVariance | BabelNodeVoidTypeAnnotation; +type BabelNodeFlowType = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeExistsTypeAnnotation | BabelNodeFunctionTypeAnnotation | BabelNodeGenericTypeAnnotation | BabelNodeInterfaceTypeAnnotation | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumberLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeObjectTypeAnnotation | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeSymbolTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeUnionTypeAnnotation | BabelNodeVoidTypeAnnotation; +type BabelNodeFlowBaseAnnotation = BabelNodeAnyTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeSymbolTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeVoidTypeAnnotation; type BabelNodeFlowDeclaration = BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias; type BabelNodeFlowPredicate = BabelNodeDeclaredPredicate | BabelNodeInferredPredicate; +type BabelNodeEnumBody = BabelNodeEnumBooleanBody | BabelNodeEnumNumberBody | BabelNodeEnumStringBody | BabelNodeEnumSymbolBody; +type BabelNodeEnumMember = BabelNodeEnumBooleanMember | BabelNodeEnumNumberMember | BabelNodeEnumStringMember | BabelNodeEnumDefaultedMember; type BabelNodeJSX = BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXEmptyExpression | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName | BabelNodeJSXOpeningElement | BabelNodeJSXSpreadAttribute | BabelNodeJSXText | BabelNodeJSXFragment | BabelNodeJSXOpeningFragment | BabelNodeJSXClosingFragment; type BabelNodePrivate = BabelNodeClassPrivateProperty | BabelNodeClassPrivateMethod | BabelNodePrivateName; type BabelNodeTSTypeElement = BabelNodeTSCallSignatureDeclaration | BabelNodeTSConstructSignatureDeclaration | BabelNodeTSPropertySignature | BabelNodeTSMethodSignature | BabelNodeTSIndexSignature; -type BabelNodeTSType = BabelNodeTSAnyKeyword | BabelNodeTSUnknownKeyword | BabelNodeTSNumberKeyword | BabelNodeTSObjectKeyword | BabelNodeTSBooleanKeyword | BabelNodeTSStringKeyword | BabelNodeTSSymbolKeyword | BabelNodeTSVoidKeyword | BabelNodeTSUndefinedKeyword | BabelNodeTSNullKeyword | BabelNodeTSNeverKeyword | BabelNodeTSThisType | BabelNodeTSFunctionType | BabelNodeTSConstructorType | BabelNodeTSTypeReference | BabelNodeTSTypePredicate | BabelNodeTSTypeQuery | BabelNodeTSTypeLiteral | BabelNodeTSArrayType | BabelNodeTSTupleType | BabelNodeTSOptionalType | BabelNodeTSRestType | BabelNodeTSUnionType | BabelNodeTSIntersectionType | BabelNodeTSConditionalType | BabelNodeTSInferType | BabelNodeTSParenthesizedType | BabelNodeTSTypeOperator | BabelNodeTSIndexedAccessType | BabelNodeTSMappedType | BabelNodeTSLiteralType | BabelNodeTSExpressionWithTypeArguments | BabelNodeTSImportType; +type BabelNodeTSType = BabelNodeTSAnyKeyword | BabelNodeTSBooleanKeyword | BabelNodeTSBigIntKeyword | BabelNodeTSIntrinsicKeyword | BabelNodeTSNeverKeyword | BabelNodeTSNullKeyword | BabelNodeTSNumberKeyword | BabelNodeTSObjectKeyword | BabelNodeTSStringKeyword | BabelNodeTSSymbolKeyword | BabelNodeTSUndefinedKeyword | BabelNodeTSUnknownKeyword | BabelNodeTSVoidKeyword | BabelNodeTSThisType | BabelNodeTSFunctionType | BabelNodeTSConstructorType | BabelNodeTSTypeReference | BabelNodeTSTypePredicate | BabelNodeTSTypeQuery | BabelNodeTSTypeLiteral | BabelNodeTSArrayType | BabelNodeTSTupleType | BabelNodeTSOptionalType | BabelNodeTSRestType | BabelNodeTSUnionType | BabelNodeTSIntersectionType | BabelNodeTSConditionalType | BabelNodeTSInferType | BabelNodeTSParenthesizedType | BabelNodeTSTypeOperator | BabelNodeTSIndexedAccessType | BabelNodeTSMappedType | BabelNodeTSLiteralType | BabelNodeTSExpressionWithTypeArguments | BabelNodeTSImportType; +type BabelNodeTSBaseType = BabelNodeTSAnyKeyword | BabelNodeTSBooleanKeyword | BabelNodeTSBigIntKeyword | BabelNodeTSIntrinsicKeyword | BabelNodeTSNeverKeyword | BabelNodeTSNullKeyword | BabelNodeTSNumberKeyword | BabelNodeTSObjectKeyword | BabelNodeTSStringKeyword | BabelNodeTSSymbolKeyword | BabelNodeTSUndefinedKeyword | BabelNodeTSUnknownKeyword | BabelNodeTSVoidKeyword | BabelNodeTSThisType | BabelNodeTSLiteralType; declare module "@babel/types" { declare function arrayExpression(elements?: Array): BabelNodeArrayExpression; declare function assignmentExpression(operator: string, left: BabelNodeLVal, right: BabelNodeExpression): BabelNodeAssignmentExpression; - declare function binaryExpression(operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", left: BabelNodeExpression, right: BabelNodeExpression): BabelNodeBinaryExpression; + declare function binaryExpression(operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", left: BabelNodeExpression | BabelNodePrivateName, right: BabelNodeExpression): BabelNodeBinaryExpression; declare function interpreterDirective(value: string): BabelNodeInterpreterDirective; declare function directive(value: BabelNodeDirectiveLiteral): BabelNodeDirective; declare function directiveLiteral(value: string): BabelNodeDirectiveLiteral; declare function blockStatement(body: Array, directives?: Array): BabelNodeBlockStatement; declare function breakStatement(label?: BabelNodeIdentifier): BabelNodeBreakStatement; - declare function callExpression(callee: BabelNodeExpression, _arguments: Array, optional?: true | false, typeArguments?: BabelNodeTypeParameterInstantiation, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeCallExpression; - declare function catchClause(param?: BabelNodeIdentifier, body: BabelNodeBlockStatement): BabelNodeCatchClause; + declare function callExpression(callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier, _arguments: Array): BabelNodeCallExpression; + declare function catchClause(param?: BabelNodeIdentifier | BabelNodeArrayPattern | BabelNodeObjectPattern, body: BabelNodeBlockStatement): BabelNodeCatchClause; declare function conditionalExpression(test: BabelNodeExpression, consequent: BabelNodeExpression, alternate: BabelNodeExpression): BabelNodeConditionalExpression; declare function continueStatement(label?: BabelNodeIdentifier): BabelNodeContinueStatement; declare function debuggerStatement(): BabelNodeDebuggerStatement; declare function doWhileStatement(test: BabelNodeExpression, body: BabelNodeStatement): BabelNodeDoWhileStatement; declare function emptyStatement(): BabelNodeEmptyStatement; declare function expressionStatement(expression: BabelNodeExpression): BabelNodeExpressionStatement; - declare function file(program: BabelNodeProgram, comments: any, tokens: any): BabelNodeFile; + declare function file(program: BabelNodeProgram, comments?: Array, tokens?: Array): BabelNodeFile; declare function forInStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForInStatement; declare function forStatement(init?: BabelNodeVariableDeclaration | BabelNodeExpression, test?: BabelNodeExpression, update?: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForStatement; - declare function functionDeclaration(id?: BabelNodeIdentifier, params: Array, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean, declare?: boolean, returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeFunctionDeclaration; - declare function functionExpression(id?: BabelNodeIdentifier, params: Array, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean, returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeFunctionExpression; - declare function identifier(name: string, decorators?: Array, optional?: boolean, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeIdentifier; + declare function functionDeclaration(id?: BabelNodeIdentifier, params: Array, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean): BabelNodeFunctionDeclaration; + declare function functionExpression(id?: BabelNodeIdentifier, params: Array, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean): BabelNodeFunctionExpression; + declare function identifier(name: string): BabelNodeIdentifier; declare function ifStatement(test: BabelNodeExpression, consequent: BabelNodeStatement, alternate?: BabelNodeStatement): BabelNodeIfStatement; declare function labeledStatement(label: BabelNodeIdentifier, body: BabelNodeStatement): BabelNodeLabeledStatement; declare function stringLiteral(value: string): BabelNodeStringLiteral; @@ -1496,13 +1609,13 @@ declare module "@babel/types" { declare function booleanLiteral(value: boolean): BabelNodeBooleanLiteral; declare function regExpLiteral(pattern: string, flags?: string): BabelNodeRegExpLiteral; declare function logicalExpression(operator: "||" | "&&" | "??", left: BabelNodeExpression, right: BabelNodeExpression): BabelNodeLogicalExpression; - declare function memberExpression(object: BabelNodeExpression, property: any, computed?: boolean, optional?: true | false): BabelNodeMemberExpression; - declare function newExpression(callee: BabelNodeExpression, _arguments: Array, optional?: true | false, typeArguments?: BabelNodeTypeParameterInstantiation, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeNewExpression; - declare function program(body: Array, directives?: Array, sourceType?: "script" | "module", interpreter?: BabelNodeInterpreterDirective, sourceFile?: string): BabelNodeProgram; + declare function memberExpression(object: BabelNodeExpression, property: BabelNodeExpression | BabelNodeIdentifier | BabelNodePrivateName, computed?: boolean, optional?: true | false): BabelNodeMemberExpression; + declare function newExpression(callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier, _arguments: Array): BabelNodeNewExpression; + declare function program(body: Array, directives?: Array, sourceType?: "script" | "module", interpreter?: BabelNodeInterpreterDirective): BabelNodeProgram; declare function objectExpression(properties: Array): BabelNodeObjectExpression; - declare function objectMethod(kind?: "method" | "get" | "set", key: any, params: Array, body: BabelNodeBlockStatement, computed?: boolean, async?: boolean, decorators?: Array, generator?: boolean, returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeObjectMethod; - declare function objectProperty(key: any, value: BabelNodeExpression | BabelNodePatternLike, computed?: boolean, shorthand?: boolean, decorators?: Array): BabelNodeObjectProperty; - declare function restElement(argument: BabelNodeLVal, decorators?: Array, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeRestElement; + declare function objectMethod(kind?: "method" | "get" | "set", key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral, params: Array, body: BabelNodeBlockStatement, computed?: boolean, generator?: boolean, async?: boolean): BabelNodeObjectMethod; + declare function objectProperty(key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral, value: BabelNodeExpression | BabelNodePatternLike, computed?: boolean, shorthand?: boolean, decorators?: Array): BabelNodeObjectProperty; + declare function restElement(argument: BabelNodeLVal): BabelNodeRestElement; declare function returnStatement(argument?: BabelNodeExpression): BabelNodeReturnStatement; declare function sequenceExpression(expressions: Array): BabelNodeSequenceExpression; declare function parenthesizedExpression(expression: BabelNodeExpression): BabelNodeParenthesizedExpression; @@ -1513,57 +1626,66 @@ declare module "@babel/types" { declare function tryStatement(block: BabelNodeBlockStatement, handler?: BabelNodeCatchClause, finalizer?: BabelNodeBlockStatement): BabelNodeTryStatement; declare function unaryExpression(operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof", argument: BabelNodeExpression, prefix?: boolean): BabelNodeUnaryExpression; declare function updateExpression(operator: "++" | "--", argument: BabelNodeExpression, prefix?: boolean): BabelNodeUpdateExpression; - declare function variableDeclaration(kind: "var" | "let" | "const", declarations: Array, declare?: boolean): BabelNodeVariableDeclaration; - declare function variableDeclarator(id: BabelNodeLVal, init?: BabelNodeExpression, definite?: boolean): BabelNodeVariableDeclarator; - declare function whileStatement(test: BabelNodeExpression, body: BabelNodeBlockStatement | BabelNodeStatement): BabelNodeWhileStatement; - declare function withStatement(object: BabelNodeExpression, body: BabelNodeBlockStatement | BabelNodeStatement): BabelNodeWithStatement; - declare function assignmentPattern(left: BabelNodeIdentifier | BabelNodeObjectPattern | BabelNodeArrayPattern | BabelNodeMemberExpression, right: BabelNodeExpression, decorators?: Array, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeAssignmentPattern; - declare function arrayPattern(elements: Array, decorators?: Array, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeArrayPattern; - declare function arrowFunctionExpression(params: Array, body: BabelNodeBlockStatement | BabelNodeExpression, async?: boolean, expression?: boolean, generator?: boolean, returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeArrowFunctionExpression; + declare function variableDeclaration(kind: "var" | "let" | "const", declarations: Array): BabelNodeVariableDeclaration; + declare function variableDeclarator(id: BabelNodeLVal, init?: BabelNodeExpression): BabelNodeVariableDeclarator; + declare function whileStatement(test: BabelNodeExpression, body: BabelNodeStatement): BabelNodeWhileStatement; + declare function withStatement(object: BabelNodeExpression, body: BabelNodeStatement): BabelNodeWithStatement; + declare function assignmentPattern(left: BabelNodeIdentifier | BabelNodeObjectPattern | BabelNodeArrayPattern | BabelNodeMemberExpression, right: BabelNodeExpression): BabelNodeAssignmentPattern; + declare function arrayPattern(elements: Array): BabelNodeArrayPattern; + declare function arrowFunctionExpression(params: Array, body: BabelNodeBlockStatement | BabelNodeExpression, async?: boolean): BabelNodeArrowFunctionExpression; declare function classBody(body: Array): BabelNodeClassBody; - declare function classDeclaration(id?: BabelNodeIdentifier, superClass?: BabelNodeExpression, body: BabelNodeClassBody, decorators?: Array, abstract?: boolean, declare?: boolean, _implements?: Array, mixins?: any, superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeClassDeclaration; - declare function classExpression(id?: BabelNodeIdentifier, superClass?: BabelNodeExpression, body: BabelNodeClassBody, decorators?: Array, _implements?: Array, mixins?: any, superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeClassExpression; + declare function classExpression(id?: BabelNodeIdentifier, superClass?: BabelNodeExpression, body: BabelNodeClassBody, decorators?: Array): BabelNodeClassExpression; + declare function classDeclaration(id: BabelNodeIdentifier, superClass?: BabelNodeExpression, body: BabelNodeClassBody, decorators?: Array): BabelNodeClassDeclaration; declare function exportAllDeclaration(source: BabelNodeStringLiteral): BabelNodeExportAllDeclaration; declare function exportDefaultDeclaration(declaration: BabelNodeFunctionDeclaration | BabelNodeTSDeclareFunction | BabelNodeClassDeclaration | BabelNodeExpression): BabelNodeExportDefaultDeclaration; - declare function exportNamedDeclaration(declaration?: BabelNodeDeclaration, specifiers: Array, source?: BabelNodeStringLiteral, exportKind?: "type" | "value"): BabelNodeExportNamedDeclaration; - declare function exportSpecifier(local: BabelNodeIdentifier, exported: BabelNodeIdentifier): BabelNodeExportSpecifier; + declare function exportNamedDeclaration(declaration?: BabelNodeDeclaration, specifiers?: Array, source?: BabelNodeStringLiteral): BabelNodeExportNamedDeclaration; + declare function exportSpecifier(local: BabelNodeIdentifier, exported: BabelNodeIdentifier | BabelNodeStringLiteral): BabelNodeExportSpecifier; declare function forOfStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement, _await?: boolean): BabelNodeForOfStatement; - declare function importDeclaration(specifiers: Array, source: BabelNodeStringLiteral, importKind?: "type" | "typeof" | "value"): BabelNodeImportDeclaration; + declare function importDeclaration(specifiers: Array, source: BabelNodeStringLiteral): BabelNodeImportDeclaration; declare function importDefaultSpecifier(local: BabelNodeIdentifier): BabelNodeImportDefaultSpecifier; declare function importNamespaceSpecifier(local: BabelNodeIdentifier): BabelNodeImportNamespaceSpecifier; - declare function importSpecifier(local: BabelNodeIdentifier, imported: BabelNodeIdentifier, importKind?: "type" | "typeof"): BabelNodeImportSpecifier; + declare function importSpecifier(local: BabelNodeIdentifier, imported: BabelNodeIdentifier | BabelNodeStringLiteral): BabelNodeImportSpecifier; declare function metaProperty(meta: BabelNodeIdentifier, property: BabelNodeIdentifier): BabelNodeMetaProperty; - declare function classMethod(kind?: "get" | "set" | "method" | "constructor", key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, params: Array, body: BabelNodeBlockStatement, computed?: boolean, _static?: boolean, abstract?: boolean, access?: "public" | "private" | "protected", accessibility?: "public" | "private" | "protected", async?: boolean, decorators?: Array, generator?: boolean, optional?: boolean, returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop): BabelNodeClassMethod; - declare function objectPattern(properties: Array, decorators?: Array, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeObjectPattern; + declare function classMethod(kind?: "get" | "set" | "method" | "constructor", key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, params: Array, body: BabelNodeBlockStatement, computed?: boolean, _static?: boolean, generator?: boolean, async?: boolean): BabelNodeClassMethod; + declare function objectPattern(properties: Array): BabelNodeObjectPattern; declare function spreadElement(argument: BabelNodeExpression): BabelNodeSpreadElement; - declare function taggedTemplateExpression(tag: BabelNodeExpression, quasi: BabelNodeTemplateLiteral, typeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation): BabelNodeTaggedTemplateExpression; + declare function _super(): BabelNodeSuper; + declare export { _super as super } + declare function taggedTemplateExpression(tag: BabelNodeExpression, quasi: BabelNodeTemplateLiteral): BabelNodeTaggedTemplateExpression; declare function templateElement(value: { raw: string, cooked?: string }, tail?: boolean): BabelNodeTemplateElement; - declare function templateLiteral(quasis: Array, expressions: Array): BabelNodeTemplateLiteral; + declare function templateLiteral(quasis: Array, expressions: Array): BabelNodeTemplateLiteral; declare function yieldExpression(argument?: BabelNodeExpression, delegate?: boolean): BabelNodeYieldExpression; + declare function awaitExpression(argument: BabelNodeExpression): BabelNodeAwaitExpression; + declare function _import(): BabelNodeImport; + declare export { _import as import } + declare function bigIntLiteral(value: string): BabelNodeBigIntLiteral; + declare function exportNamespaceSpecifier(exported: BabelNodeIdentifier): BabelNodeExportNamespaceSpecifier; + declare function optionalMemberExpression(object: BabelNodeExpression, property: BabelNodeExpression | BabelNodeIdentifier, computed?: boolean, optional: boolean): BabelNodeOptionalMemberExpression; + declare function optionalCallExpression(callee: BabelNodeExpression, _arguments: Array, optional: boolean): BabelNodeOptionalCallExpression; declare function anyTypeAnnotation(): BabelNodeAnyTypeAnnotation; declare function arrayTypeAnnotation(elementType: BabelNodeFlowType): BabelNodeArrayTypeAnnotation; declare function booleanTypeAnnotation(): BabelNodeBooleanTypeAnnotation; declare function booleanLiteralTypeAnnotation(value: boolean): BabelNodeBooleanLiteralTypeAnnotation; declare function nullLiteralTypeAnnotation(): BabelNodeNullLiteralTypeAnnotation; declare function classImplements(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeClassImplements; - declare function declareClass(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation, _implements?: Array, mixins?: Array): BabelNodeDeclareClass; - declare function declareFunction(id: BabelNodeIdentifier, predicate?: BabelNodeDeclaredPredicate): BabelNodeDeclareFunction; - declare function declareInterface(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation, _implements?: Array, mixins?: Array): BabelNodeDeclareInterface; + declare function declareClass(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation): BabelNodeDeclareClass; + declare function declareFunction(id: BabelNodeIdentifier): BabelNodeDeclareFunction; + declare function declareInterface(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation): BabelNodeDeclareInterface; declare function declareModule(id: BabelNodeIdentifier | BabelNodeStringLiteral, body: BabelNodeBlockStatement, kind?: "CommonJS" | "ES"): BabelNodeDeclareModule; declare function declareModuleExports(typeAnnotation: BabelNodeTypeAnnotation): BabelNodeDeclareModuleExports; declare function declareTypeAlias(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, right: BabelNodeFlowType): BabelNodeDeclareTypeAlias; declare function declareOpaqueType(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, supertype?: BabelNodeFlowType): BabelNodeDeclareOpaqueType; declare function declareVariable(id: BabelNodeIdentifier): BabelNodeDeclareVariable; - declare function declareExportDeclaration(declaration?: BabelNodeFlow, specifiers?: Array, source?: BabelNodeStringLiteral, _default?: boolean): BabelNodeDeclareExportDeclaration; - declare function declareExportAllDeclaration(source: BabelNodeStringLiteral, exportKind?: "type" | "value"): BabelNodeDeclareExportAllDeclaration; + declare function declareExportDeclaration(declaration?: BabelNodeFlow, specifiers?: Array, source?: BabelNodeStringLiteral): BabelNodeDeclareExportDeclaration; + declare function declareExportAllDeclaration(source: BabelNodeStringLiteral): BabelNodeDeclareExportAllDeclaration; declare function declaredPredicate(value: BabelNodeFlow): BabelNodeDeclaredPredicate; declare function existsTypeAnnotation(): BabelNodeExistsTypeAnnotation; declare function functionTypeAnnotation(typeParameters?: BabelNodeTypeParameterDeclaration, params: Array, rest?: BabelNodeFunctionTypeParam, returnType: BabelNodeFlowType): BabelNodeFunctionTypeAnnotation; - declare function functionTypeParam(name?: BabelNodeIdentifier, typeAnnotation: BabelNodeFlowType, optional?: boolean): BabelNodeFunctionTypeParam; + declare function functionTypeParam(name?: BabelNodeIdentifier, typeAnnotation: BabelNodeFlowType): BabelNodeFunctionTypeParam; declare function genericTypeAnnotation(id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeGenericTypeAnnotation; declare function inferredPredicate(): BabelNodeInferredPredicate; declare function interfaceExtends(id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeInterfaceExtends; - declare function interfaceDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation, _implements?: Array, mixins?: Array): BabelNodeInterfaceDeclaration; + declare function interfaceDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation): BabelNodeInterfaceDeclaration; declare function interfaceTypeAnnotation(_extends?: Array, body: BabelNodeObjectTypeAnnotation): BabelNodeInterfaceTypeAnnotation; declare function intersectionTypeAnnotation(types: Array): BabelNodeIntersectionTypeAnnotation; declare function mixedTypeAnnotation(): BabelNodeMixedTypeAnnotation; @@ -1571,38 +1693,48 @@ declare module "@babel/types" { declare function nullableTypeAnnotation(typeAnnotation: BabelNodeFlowType): BabelNodeNullableTypeAnnotation; declare function numberLiteralTypeAnnotation(value: number): BabelNodeNumberLiteralTypeAnnotation; declare function numberTypeAnnotation(): BabelNodeNumberTypeAnnotation; - declare function objectTypeAnnotation(properties: Array, indexers?: Array, callProperties?: Array, internalSlots?: Array, exact?: boolean, inexact?: boolean): BabelNodeObjectTypeAnnotation; + declare function objectTypeAnnotation(properties: Array, indexers?: Array, callProperties?: Array, internalSlots?: Array, exact?: boolean): BabelNodeObjectTypeAnnotation; declare function objectTypeInternalSlot(id: BabelNodeIdentifier, value: BabelNodeFlowType, optional: boolean, _static: boolean, method: boolean): BabelNodeObjectTypeInternalSlot; - declare function objectTypeCallProperty(value: BabelNodeFlowType, _static?: boolean): BabelNodeObjectTypeCallProperty; - declare function objectTypeIndexer(id?: BabelNodeIdentifier, key: BabelNodeFlowType, value: BabelNodeFlowType, variance?: BabelNodeVariance, _static?: boolean): BabelNodeObjectTypeIndexer; - declare function objectTypeProperty(key: BabelNodeIdentifier | BabelNodeStringLiteral, value: BabelNodeFlowType, variance?: BabelNodeVariance, kind?: "init" | "get" | "set", optional?: boolean, proto?: boolean, _static?: boolean): BabelNodeObjectTypeProperty; + declare function objectTypeCallProperty(value: BabelNodeFlowType): BabelNodeObjectTypeCallProperty; + declare function objectTypeIndexer(id?: BabelNodeIdentifier, key: BabelNodeFlowType, value: BabelNodeFlowType, variance?: BabelNodeVariance): BabelNodeObjectTypeIndexer; + declare function objectTypeProperty(key: BabelNodeIdentifier | BabelNodeStringLiteral, value: BabelNodeFlowType, variance?: BabelNodeVariance): BabelNodeObjectTypeProperty; declare function objectTypeSpreadProperty(argument: BabelNodeFlowType): BabelNodeObjectTypeSpreadProperty; declare function opaqueType(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, supertype?: BabelNodeFlowType, impltype: BabelNodeFlowType): BabelNodeOpaqueType; declare function qualifiedTypeIdentifier(id: BabelNodeIdentifier, qualification: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier): BabelNodeQualifiedTypeIdentifier; declare function stringLiteralTypeAnnotation(value: string): BabelNodeStringLiteralTypeAnnotation; declare function stringTypeAnnotation(): BabelNodeStringTypeAnnotation; + declare function symbolTypeAnnotation(): BabelNodeSymbolTypeAnnotation; declare function thisTypeAnnotation(): BabelNodeThisTypeAnnotation; declare function tupleTypeAnnotation(types: Array): BabelNodeTupleTypeAnnotation; declare function typeofTypeAnnotation(argument: BabelNodeFlowType): BabelNodeTypeofTypeAnnotation; declare function typeAlias(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, right: BabelNodeFlowType): BabelNodeTypeAlias; declare function typeAnnotation(typeAnnotation: BabelNodeFlowType): BabelNodeTypeAnnotation; declare function typeCastExpression(expression: BabelNodeExpression, typeAnnotation: BabelNodeTypeAnnotation): BabelNodeTypeCastExpression; - declare function typeParameter(bound?: BabelNodeTypeAnnotation, _default?: BabelNodeFlowType, variance?: BabelNodeVariance, name?: string): BabelNodeTypeParameter; + declare function typeParameter(bound?: BabelNodeTypeAnnotation, _default?: BabelNodeFlowType, variance?: BabelNodeVariance): BabelNodeTypeParameter; declare function typeParameterDeclaration(params: Array): BabelNodeTypeParameterDeclaration; declare function typeParameterInstantiation(params: Array): BabelNodeTypeParameterInstantiation; declare function unionTypeAnnotation(types: Array): BabelNodeUnionTypeAnnotation; declare function variance(kind: "minus" | "plus"): BabelNodeVariance; declare function voidTypeAnnotation(): BabelNodeVoidTypeAnnotation; + declare function enumDeclaration(id: BabelNodeIdentifier, body: BabelNodeEnumBooleanBody | BabelNodeEnumNumberBody | BabelNodeEnumStringBody | BabelNodeEnumSymbolBody): BabelNodeEnumDeclaration; + declare function enumBooleanBody(members: Array): BabelNodeEnumBooleanBody; + declare function enumNumberBody(members: Array): BabelNodeEnumNumberBody; + declare function enumStringBody(members: Array): BabelNodeEnumStringBody; + declare function enumSymbolBody(members: Array): BabelNodeEnumSymbolBody; + declare function enumBooleanMember(id: BabelNodeIdentifier): BabelNodeEnumBooleanMember; + declare function enumNumberMember(id: BabelNodeIdentifier, init: BabelNodeNumericLiteral): BabelNodeEnumNumberMember; + declare function enumStringMember(id: BabelNodeIdentifier, init: BabelNodeStringLiteral): BabelNodeEnumStringMember; + declare function enumDefaultedMember(id: BabelNodeIdentifier): BabelNodeEnumDefaultedMember; declare function jsxAttribute(name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName, value?: BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeStringLiteral | BabelNodeJSXExpressionContainer): BabelNodeJSXAttribute; - declare function jsxClosingElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression): BabelNodeJSXClosingElement; - declare function jsxElement(openingElement: BabelNodeJSXOpeningElement, closingElement?: BabelNodeJSXClosingElement, children: Array, selfClosing: any): BabelNodeJSXElement; + declare function jsxClosingElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName): BabelNodeJSXClosingElement; + declare function jsxElement(openingElement: BabelNodeJSXOpeningElement, closingElement?: BabelNodeJSXClosingElement, children: Array, selfClosing?: boolean): BabelNodeJSXElement; declare function jsxEmptyExpression(): BabelNodeJSXEmptyExpression; declare function jsxExpressionContainer(expression: BabelNodeExpression | BabelNodeJSXEmptyExpression): BabelNodeJSXExpressionContainer; declare function jsxSpreadChild(expression: BabelNodeExpression): BabelNodeJSXSpreadChild; declare function jsxIdentifier(name: string): BabelNodeJSXIdentifier; declare function jsxMemberExpression(object: BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier, property: BabelNodeJSXIdentifier): BabelNodeJSXMemberExpression; declare function jsxNamespacedName(namespace: BabelNodeJSXIdentifier, name: BabelNodeJSXIdentifier): BabelNodeJSXNamespacedName; - declare function jsxOpeningElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression, attributes: Array, selfClosing?: boolean, typeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation): BabelNodeJSXOpeningElement; + declare function jsxOpeningElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName, attributes: Array, selfClosing?: boolean): BabelNodeJSXOpeningElement; declare function jsxSpreadAttribute(argument: BabelNodeExpression): BabelNodeJSXSpreadAttribute; declare function jsxText(value: string): BabelNodeJSXText; declare function jsxFragment(openingFragment: BabelNodeJSXOpeningFragment, closingFragment: BabelNodeJSXClosingFragment, children: Array): BabelNodeJSXFragment; @@ -1610,75 +1742,79 @@ declare module "@babel/types" { declare function jsxClosingFragment(): BabelNodeJSXClosingFragment; declare function noop(): BabelNodeNoop; declare function placeholder(expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern", name: BabelNodeIdentifier): BabelNodePlaceholder; + declare function v8IntrinsicIdentifier(name: string): BabelNodeV8IntrinsicIdentifier; declare function argumentPlaceholder(): BabelNodeArgumentPlaceholder; - declare function awaitExpression(argument: BabelNodeExpression): BabelNodeAwaitExpression; - declare function bindExpression(object: any, callee: any): BabelNodeBindExpression; - declare function classProperty(key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, value?: BabelNodeExpression, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, decorators?: Array, computed?: boolean, abstract?: boolean, accessibility?: "public" | "private" | "protected", definite?: boolean, optional?: boolean, readonly?: boolean, _static?: boolean): BabelNodeClassProperty; - declare function optionalMemberExpression(object: BabelNodeExpression, property: any, computed?: boolean, optional: boolean): BabelNodeOptionalMemberExpression; + declare function bindExpression(object: BabelNodeExpression, callee: BabelNodeExpression): BabelNodeBindExpression; + declare function classProperty(key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, value?: BabelNodeExpression, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, decorators?: Array, computed?: boolean, _static?: boolean): BabelNodeClassProperty; declare function pipelineTopicExpression(expression: BabelNodeExpression): BabelNodePipelineTopicExpression; declare function pipelineBareFunction(callee: BabelNodeExpression): BabelNodePipelineBareFunction; declare function pipelinePrimaryTopicReference(): BabelNodePipelinePrimaryTopicReference; - declare function optionalCallExpression(callee: BabelNodeExpression, _arguments: Array, optional: boolean, typeArguments?: BabelNodeTypeParameterInstantiation, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeOptionalCallExpression; - declare function classPrivateProperty(key: BabelNodePrivateName, value?: BabelNodeExpression): BabelNodeClassPrivateProperty; - declare function classPrivateMethod(kind?: "get" | "set" | "method" | "constructor", key: BabelNodePrivateName, params: Array, body: BabelNodeBlockStatement, _static?: boolean, abstract?: boolean, access?: "public" | "private" | "protected", accessibility?: "public" | "private" | "protected", async?: boolean, computed?: boolean, decorators?: Array, generator?: boolean, optional?: boolean, returnType?: any, typeParameters?: any): BabelNodeClassPrivateMethod; + declare function classPrivateProperty(key: BabelNodePrivateName, value?: BabelNodeExpression, decorators?: Array, _static: any): BabelNodeClassPrivateProperty; + declare function classPrivateMethod(kind?: "get" | "set" | "method" | "constructor", key: BabelNodePrivateName, params: Array, body: BabelNodeBlockStatement, _static?: boolean): BabelNodeClassPrivateMethod; + declare function importAttribute(key: BabelNodeIdentifier | BabelNodeStringLiteral, value: BabelNodeStringLiteral): BabelNodeImportAttribute; declare function decorator(expression: BabelNodeExpression): BabelNodeDecorator; declare function doExpression(body: BabelNodeBlockStatement): BabelNodeDoExpression; declare function exportDefaultSpecifier(exported: BabelNodeIdentifier): BabelNodeExportDefaultSpecifier; - declare function exportNamespaceSpecifier(exported: BabelNodeIdentifier): BabelNodeExportNamespaceSpecifier; declare function privateName(id: BabelNodeIdentifier): BabelNodePrivateName; - declare function bigIntLiteral(value: string): BabelNodeBigIntLiteral; - declare function tsParameterProperty(parameter: BabelNodeIdentifier | BabelNodeAssignmentPattern, accessibility?: "public" | "private" | "protected", readonly?: boolean): BabelNodeTSParameterProperty; - declare function tsDeclareFunction(id?: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop, params: Array, returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop, async?: boolean, declare?: boolean, generator?: boolean): BabelNodeTSDeclareFunction; - declare function tsDeclareMethod(decorators?: Array, key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop, params: Array, returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop, abstract?: boolean, access?: "public" | "private" | "protected", accessibility?: "public" | "private" | "protected", async?: boolean, computed?: boolean, generator?: boolean, kind?: "get" | "set" | "method" | "constructor", optional?: boolean, _static?: boolean): BabelNodeTSDeclareMethod; + declare function recordExpression(properties: Array): BabelNodeRecordExpression; + declare function tupleExpression(elements?: Array): BabelNodeTupleExpression; + declare function decimalLiteral(value: string): BabelNodeDecimalLiteral; + declare function staticBlock(body: Array): BabelNodeStaticBlock; + declare function tsParameterProperty(parameter: BabelNodeIdentifier | BabelNodeAssignmentPattern): BabelNodeTSParameterProperty; + declare function tsDeclareFunction(id?: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop, params: Array, returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeTSDeclareFunction; + declare function tsDeclareMethod(decorators?: Array, key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop, params: Array, returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeTSDeclareMethod; declare function tsQualifiedName(left: BabelNodeTSEntityName, right: BabelNodeIdentifier): BabelNodeTSQualifiedName; declare function tsCallSignatureDeclaration(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSCallSignatureDeclaration; declare function tsConstructSignatureDeclaration(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSConstructSignatureDeclaration; - declare function tsPropertySignature(key: BabelNodeExpression, typeAnnotation?: BabelNodeTSTypeAnnotation, initializer?: BabelNodeExpression, computed?: boolean, optional?: boolean, readonly?: boolean): BabelNodeTSPropertySignature; - declare function tsMethodSignature(key: BabelNodeExpression, typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation, computed?: boolean, optional?: boolean): BabelNodeTSMethodSignature; - declare function tsIndexSignature(parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation, readonly?: boolean): BabelNodeTSIndexSignature; + declare function tsPropertySignature(key: BabelNodeExpression, typeAnnotation?: BabelNodeTSTypeAnnotation, initializer?: BabelNodeExpression): BabelNodeTSPropertySignature; + declare function tsMethodSignature(key: BabelNodeExpression, typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSMethodSignature; + declare function tsIndexSignature(parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSIndexSignature; declare function tsAnyKeyword(): BabelNodeTSAnyKeyword; - declare function tsUnknownKeyword(): BabelNodeTSUnknownKeyword; + declare function tsBooleanKeyword(): BabelNodeTSBooleanKeyword; + declare function tsBigIntKeyword(): BabelNodeTSBigIntKeyword; + declare function tsIntrinsicKeyword(): BabelNodeTSIntrinsicKeyword; + declare function tsNeverKeyword(): BabelNodeTSNeverKeyword; + declare function tsNullKeyword(): BabelNodeTSNullKeyword; declare function tsNumberKeyword(): BabelNodeTSNumberKeyword; declare function tsObjectKeyword(): BabelNodeTSObjectKeyword; - declare function tsBooleanKeyword(): BabelNodeTSBooleanKeyword; declare function tsStringKeyword(): BabelNodeTSStringKeyword; declare function tsSymbolKeyword(): BabelNodeTSSymbolKeyword; - declare function tsVoidKeyword(): BabelNodeTSVoidKeyword; declare function tsUndefinedKeyword(): BabelNodeTSUndefinedKeyword; - declare function tsNullKeyword(): BabelNodeTSNullKeyword; - declare function tsNeverKeyword(): BabelNodeTSNeverKeyword; + declare function tsUnknownKeyword(): BabelNodeTSUnknownKeyword; + declare function tsVoidKeyword(): BabelNodeTSVoidKeyword; declare function tsThisType(): BabelNodeTSThisType; declare function tsFunctionType(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSFunctionType; declare function tsConstructorType(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSConstructorType; declare function tsTypeReference(typeName: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSTypeReference; - declare function tsTypePredicate(parameterName: BabelNodeIdentifier | BabelNodeTSThisType, typeAnnotation: BabelNodeTSTypeAnnotation): BabelNodeTSTypePredicate; + declare function tsTypePredicate(parameterName: BabelNodeIdentifier | BabelNodeTSThisType, typeAnnotation?: BabelNodeTSTypeAnnotation, asserts?: boolean): BabelNodeTSTypePredicate; declare function tsTypeQuery(exprName: BabelNodeTSEntityName | BabelNodeTSImportType): BabelNodeTSTypeQuery; declare function tsTypeLiteral(members: Array): BabelNodeTSTypeLiteral; declare function tsArrayType(elementType: BabelNodeTSType): BabelNodeTSArrayType; - declare function tsTupleType(elementTypes: Array): BabelNodeTSTupleType; + declare function tsTupleType(elementTypes: Array): BabelNodeTSTupleType; declare function tsOptionalType(typeAnnotation: BabelNodeTSType): BabelNodeTSOptionalType; declare function tsRestType(typeAnnotation: BabelNodeTSType): BabelNodeTSRestType; + declare function tsNamedTupleMember(label: BabelNodeIdentifier, elementType: BabelNodeTSType, optional?: boolean): BabelNodeTSNamedTupleMember; declare function tsUnionType(types: Array): BabelNodeTSUnionType; declare function tsIntersectionType(types: Array): BabelNodeTSIntersectionType; declare function tsConditionalType(checkType: BabelNodeTSType, extendsType: BabelNodeTSType, trueType: BabelNodeTSType, falseType: BabelNodeTSType): BabelNodeTSConditionalType; declare function tsInferType(typeParameter: BabelNodeTSTypeParameter): BabelNodeTSInferType; declare function tsParenthesizedType(typeAnnotation: BabelNodeTSType): BabelNodeTSParenthesizedType; - declare function tsTypeOperator(typeAnnotation: BabelNodeTSType, operator?: string): BabelNodeTSTypeOperator; + declare function tsTypeOperator(typeAnnotation: BabelNodeTSType): BabelNodeTSTypeOperator; declare function tsIndexedAccessType(objectType: BabelNodeTSType, indexType: BabelNodeTSType): BabelNodeTSIndexedAccessType; - declare function tsMappedType(typeParameter: BabelNodeTSTypeParameter, typeAnnotation?: BabelNodeTSType, optional?: boolean, readonly?: boolean): BabelNodeTSMappedType; - declare function tsLiteralType(literal: BabelNodeNumericLiteral | BabelNodeStringLiteral | BabelNodeBooleanLiteral): BabelNodeTSLiteralType; + declare function tsMappedType(typeParameter: BabelNodeTSTypeParameter, typeAnnotation?: BabelNodeTSType, nameType?: BabelNodeTSType): BabelNodeTSMappedType; + declare function tsLiteralType(literal: BabelNodeNumericLiteral | BabelNodeStringLiteral | BabelNodeBooleanLiteral | BabelNodeBigIntLiteral): BabelNodeTSLiteralType; declare function tsExpressionWithTypeArguments(expression: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSExpressionWithTypeArguments; - declare function tsInterfaceDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration, _extends?: Array, body: BabelNodeTSInterfaceBody, declare?: boolean): BabelNodeTSInterfaceDeclaration; + declare function tsInterfaceDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration, _extends?: Array, body: BabelNodeTSInterfaceBody): BabelNodeTSInterfaceDeclaration; declare function tsInterfaceBody(body: Array): BabelNodeTSInterfaceBody; - declare function tsTypeAliasDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration, typeAnnotation: BabelNodeTSType, declare?: boolean): BabelNodeTSTypeAliasDeclaration; + declare function tsTypeAliasDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration, typeAnnotation: BabelNodeTSType): BabelNodeTSTypeAliasDeclaration; declare function tsAsExpression(expression: BabelNodeExpression, typeAnnotation: BabelNodeTSType): BabelNodeTSAsExpression; declare function tsTypeAssertion(typeAnnotation: BabelNodeTSType, expression: BabelNodeExpression): BabelNodeTSTypeAssertion; - declare function tsEnumDeclaration(id: BabelNodeIdentifier, members: Array, _const?: boolean, declare?: boolean, initializer?: BabelNodeExpression): BabelNodeTSEnumDeclaration; + declare function tsEnumDeclaration(id: BabelNodeIdentifier, members: Array): BabelNodeTSEnumDeclaration; declare function tsEnumMember(id: BabelNodeIdentifier | BabelNodeStringLiteral, initializer?: BabelNodeExpression): BabelNodeTSEnumMember; - declare function tsModuleDeclaration(id: BabelNodeIdentifier | BabelNodeStringLiteral, body: BabelNodeTSModuleBlock | BabelNodeTSModuleDeclaration, declare?: boolean, global?: boolean): BabelNodeTSModuleDeclaration; + declare function tsModuleDeclaration(id: BabelNodeIdentifier | BabelNodeStringLiteral, body: BabelNodeTSModuleBlock | BabelNodeTSModuleDeclaration): BabelNodeTSModuleDeclaration; declare function tsModuleBlock(body: Array): BabelNodeTSModuleBlock; declare function tsImportType(argument: BabelNodeStringLiteral, qualifier?: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSImportType; - declare function tsImportEqualsDeclaration(id: BabelNodeIdentifier, moduleReference: BabelNodeTSEntityName | BabelNodeTSExternalModuleReference, isExport?: boolean): BabelNodeTSImportEqualsDeclaration; + declare function tsImportEqualsDeclaration(id: BabelNodeIdentifier, moduleReference: BabelNodeTSEntityName | BabelNodeTSExternalModuleReference): BabelNodeTSImportEqualsDeclaration; declare function tsExternalModuleReference(expression: BabelNodeStringLiteral): BabelNodeTSExternalModuleReference; declare function tsNonNullExpression(expression: BabelNodeExpression): BabelNodeTSNonNullExpression; declare function tsExportAssignment(expression: BabelNodeExpression): BabelNodeTSExportAssignment; @@ -1686,281 +1822,624 @@ declare module "@babel/types" { declare function tsTypeAnnotation(typeAnnotation: BabelNodeTSType): BabelNodeTSTypeAnnotation; declare function tsTypeParameterInstantiation(params: Array): BabelNodeTSTypeParameterInstantiation; declare function tsTypeParameterDeclaration(params: Array): BabelNodeTSTypeParameterDeclaration; - declare function tsTypeParameter(constraint?: BabelNodeTSType, _default?: BabelNodeTSType, name?: string): BabelNodeTSTypeParameter; + declare function tsTypeParameter(constraint?: BabelNodeTSType, _default?: BabelNodeTSType, name: string): BabelNodeTSTypeParameter; declare function isArrayExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayExpression) + declare function assertArrayExpression(node: ?Object, opts?: ?Object): void declare function isAssignmentExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAssignmentExpression) + declare function assertAssignmentExpression(node: ?Object, opts?: ?Object): void declare function isBinaryExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBinaryExpression) + declare function assertBinaryExpression(node: ?Object, opts?: ?Object): void declare function isInterpreterDirective(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterpreterDirective) + declare function assertInterpreterDirective(node: ?Object, opts?: ?Object): void declare function isDirective(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDirective) + declare function assertDirective(node: ?Object, opts?: ?Object): void declare function isDirectiveLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDirectiveLiteral) + declare function assertDirectiveLiteral(node: ?Object, opts?: ?Object): void declare function isBlockStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBlockStatement) + declare function assertBlockStatement(node: ?Object, opts?: ?Object): void declare function isBreakStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBreakStatement) + declare function assertBreakStatement(node: ?Object, opts?: ?Object): void declare function isCallExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeCallExpression) + declare function assertCallExpression(node: ?Object, opts?: ?Object): void declare function isCatchClause(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeCatchClause) + declare function assertCatchClause(node: ?Object, opts?: ?Object): void declare function isConditionalExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeConditionalExpression) + declare function assertConditionalExpression(node: ?Object, opts?: ?Object): void declare function isContinueStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeContinueStatement) + declare function assertContinueStatement(node: ?Object, opts?: ?Object): void declare function isDebuggerStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDebuggerStatement) + declare function assertDebuggerStatement(node: ?Object, opts?: ?Object): void declare function isDoWhileStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDoWhileStatement) + declare function assertDoWhileStatement(node: ?Object, opts?: ?Object): void declare function isEmptyStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEmptyStatement) + declare function assertEmptyStatement(node: ?Object, opts?: ?Object): void declare function isExpressionStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExpressionStatement) + declare function assertExpressionStatement(node: ?Object, opts?: ?Object): void declare function isFile(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFile) + declare function assertFile(node: ?Object, opts?: ?Object): void declare function isForInStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForInStatement) + declare function assertForInStatement(node: ?Object, opts?: ?Object): void declare function isForStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForStatement) + declare function assertForStatement(node: ?Object, opts?: ?Object): void declare function isFunctionDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionDeclaration) + declare function assertFunctionDeclaration(node: ?Object, opts?: ?Object): void declare function isFunctionExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionExpression) + declare function assertFunctionExpression(node: ?Object, opts?: ?Object): void declare function isIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIdentifier) + declare function assertIdentifier(node: ?Object, opts?: ?Object): void declare function isIfStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIfStatement) + declare function assertIfStatement(node: ?Object, opts?: ?Object): void declare function isLabeledStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeLabeledStatement) + declare function assertLabeledStatement(node: ?Object, opts?: ?Object): void declare function isStringLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringLiteral) + declare function assertStringLiteral(node: ?Object, opts?: ?Object): void declare function isNumericLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumericLiteral) + declare function assertNumericLiteral(node: ?Object, opts?: ?Object): void declare function isNullLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullLiteral) + declare function assertNullLiteral(node: ?Object, opts?: ?Object): void declare function isBooleanLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanLiteral) + declare function assertBooleanLiteral(node: ?Object, opts?: ?Object): void declare function isRegExpLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRegExpLiteral) + declare function assertRegExpLiteral(node: ?Object, opts?: ?Object): void declare function isLogicalExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeLogicalExpression) + declare function assertLogicalExpression(node: ?Object, opts?: ?Object): void declare function isMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMemberExpression) + declare function assertMemberExpression(node: ?Object, opts?: ?Object): void declare function isNewExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNewExpression) + declare function assertNewExpression(node: ?Object, opts?: ?Object): void declare function isProgram(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeProgram) + declare function assertProgram(node: ?Object, opts?: ?Object): void declare function isObjectExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectExpression) + declare function assertObjectExpression(node: ?Object, opts?: ?Object): void declare function isObjectMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectMethod) + declare function assertObjectMethod(node: ?Object, opts?: ?Object): void declare function isObjectProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectProperty) + declare function assertObjectProperty(node: ?Object, opts?: ?Object): void declare function isRestElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRestElement) + declare function assertRestElement(node: ?Object, opts?: ?Object): void declare function isReturnStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeReturnStatement) + declare function assertReturnStatement(node: ?Object, opts?: ?Object): void declare function isSequenceExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSequenceExpression) + declare function assertSequenceExpression(node: ?Object, opts?: ?Object): void declare function isParenthesizedExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeParenthesizedExpression) + declare function assertParenthesizedExpression(node: ?Object, opts?: ?Object): void declare function isSwitchCase(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSwitchCase) + declare function assertSwitchCase(node: ?Object, opts?: ?Object): void declare function isSwitchStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSwitchStatement) + declare function assertSwitchStatement(node: ?Object, opts?: ?Object): void declare function isThisExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThisExpression) + declare function assertThisExpression(node: ?Object, opts?: ?Object): void declare function isThrowStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThrowStatement) + declare function assertThrowStatement(node: ?Object, opts?: ?Object): void declare function isTryStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTryStatement) + declare function assertTryStatement(node: ?Object, opts?: ?Object): void declare function isUnaryExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUnaryExpression) + declare function assertUnaryExpression(node: ?Object, opts?: ?Object): void declare function isUpdateExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUpdateExpression) + declare function assertUpdateExpression(node: ?Object, opts?: ?Object): void declare function isVariableDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariableDeclaration) + declare function assertVariableDeclaration(node: ?Object, opts?: ?Object): void declare function isVariableDeclarator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariableDeclarator) + declare function assertVariableDeclarator(node: ?Object, opts?: ?Object): void declare function isWhileStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeWhileStatement) + declare function assertWhileStatement(node: ?Object, opts?: ?Object): void declare function isWithStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeWithStatement) + declare function assertWithStatement(node: ?Object, opts?: ?Object): void declare function isAssignmentPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAssignmentPattern) + declare function assertAssignmentPattern(node: ?Object, opts?: ?Object): void declare function isArrayPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayPattern) + declare function assertArrayPattern(node: ?Object, opts?: ?Object): void declare function isArrowFunctionExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrowFunctionExpression) + declare function assertArrowFunctionExpression(node: ?Object, opts?: ?Object): void declare function isClassBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassBody) - declare function isClassDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassDeclaration) + declare function assertClassBody(node: ?Object, opts?: ?Object): void declare function isClassExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassExpression) + declare function assertClassExpression(node: ?Object, opts?: ?Object): void + declare function isClassDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassDeclaration) + declare function assertClassDeclaration(node: ?Object, opts?: ?Object): void declare function isExportAllDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportAllDeclaration) + declare function assertExportAllDeclaration(node: ?Object, opts?: ?Object): void declare function isExportDefaultDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportDefaultDeclaration) + declare function assertExportDefaultDeclaration(node: ?Object, opts?: ?Object): void declare function isExportNamedDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportNamedDeclaration) + declare function assertExportNamedDeclaration(node: ?Object, opts?: ?Object): void declare function isExportSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportSpecifier) + declare function assertExportSpecifier(node: ?Object, opts?: ?Object): void declare function isForOfStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForOfStatement) + declare function assertForOfStatement(node: ?Object, opts?: ?Object): void declare function isImportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportDeclaration) + declare function assertImportDeclaration(node: ?Object, opts?: ?Object): void declare function isImportDefaultSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportDefaultSpecifier) + declare function assertImportDefaultSpecifier(node: ?Object, opts?: ?Object): void declare function isImportNamespaceSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportNamespaceSpecifier) + declare function assertImportNamespaceSpecifier(node: ?Object, opts?: ?Object): void declare function isImportSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportSpecifier) + declare function assertImportSpecifier(node: ?Object, opts?: ?Object): void declare function isMetaProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMetaProperty) + declare function assertMetaProperty(node: ?Object, opts?: ?Object): void declare function isClassMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassMethod) + declare function assertClassMethod(node: ?Object, opts?: ?Object): void declare function isObjectPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectPattern) + declare function assertObjectPattern(node: ?Object, opts?: ?Object): void declare function isSpreadElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSpreadElement) + declare function assertSpreadElement(node: ?Object, opts?: ?Object): void declare function isSuper(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSuper) + declare function assertSuper(node: ?Object, opts?: ?Object): void declare function isTaggedTemplateExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTaggedTemplateExpression) + declare function assertTaggedTemplateExpression(node: ?Object, opts?: ?Object): void declare function isTemplateElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTemplateElement) + declare function assertTemplateElement(node: ?Object, opts?: ?Object): void declare function isTemplateLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTemplateLiteral) + declare function assertTemplateLiteral(node: ?Object, opts?: ?Object): void declare function isYieldExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeYieldExpression) + declare function assertYieldExpression(node: ?Object, opts?: ?Object): void + declare function isAwaitExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAwaitExpression) + declare function assertAwaitExpression(node: ?Object, opts?: ?Object): void + declare function isImport(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImport) + declare function assertImport(node: ?Object, opts?: ?Object): void + declare function isBigIntLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBigIntLiteral) + declare function assertBigIntLiteral(node: ?Object, opts?: ?Object): void + declare function isExportNamespaceSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportNamespaceSpecifier) + declare function assertExportNamespaceSpecifier(node: ?Object, opts?: ?Object): void + declare function isOptionalMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalMemberExpression) + declare function assertOptionalMemberExpression(node: ?Object, opts?: ?Object): void + declare function isOptionalCallExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalCallExpression) + declare function assertOptionalCallExpression(node: ?Object, opts?: ?Object): void declare function isAnyTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAnyTypeAnnotation) + declare function assertAnyTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isArrayTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayTypeAnnotation) + declare function assertArrayTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isBooleanTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanTypeAnnotation) + declare function assertBooleanTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isBooleanLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanLiteralTypeAnnotation) + declare function assertBooleanLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isNullLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullLiteralTypeAnnotation) + declare function assertNullLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isClassImplements(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassImplements) + declare function assertClassImplements(node: ?Object, opts?: ?Object): void declare function isDeclareClass(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareClass) + declare function assertDeclareClass(node: ?Object, opts?: ?Object): void declare function isDeclareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareFunction) + declare function assertDeclareFunction(node: ?Object, opts?: ?Object): void declare function isDeclareInterface(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareInterface) + declare function assertDeclareInterface(node: ?Object, opts?: ?Object): void declare function isDeclareModule(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareModule) + declare function assertDeclareModule(node: ?Object, opts?: ?Object): void declare function isDeclareModuleExports(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareModuleExports) + declare function assertDeclareModuleExports(node: ?Object, opts?: ?Object): void declare function isDeclareTypeAlias(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareTypeAlias) + declare function assertDeclareTypeAlias(node: ?Object, opts?: ?Object): void declare function isDeclareOpaqueType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareOpaqueType) + declare function assertDeclareOpaqueType(node: ?Object, opts?: ?Object): void declare function isDeclareVariable(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareVariable) + declare function assertDeclareVariable(node: ?Object, opts?: ?Object): void declare function isDeclareExportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareExportDeclaration) + declare function assertDeclareExportDeclaration(node: ?Object, opts?: ?Object): void declare function isDeclareExportAllDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareExportAllDeclaration) + declare function assertDeclareExportAllDeclaration(node: ?Object, opts?: ?Object): void declare function isDeclaredPredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclaredPredicate) + declare function assertDeclaredPredicate(node: ?Object, opts?: ?Object): void declare function isExistsTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExistsTypeAnnotation) + declare function assertExistsTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isFunctionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionTypeAnnotation) + declare function assertFunctionTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isFunctionTypeParam(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionTypeParam) + declare function assertFunctionTypeParam(node: ?Object, opts?: ?Object): void declare function isGenericTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeGenericTypeAnnotation) + declare function assertGenericTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isInferredPredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInferredPredicate) + declare function assertInferredPredicate(node: ?Object, opts?: ?Object): void declare function isInterfaceExtends(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceExtends) + declare function assertInterfaceExtends(node: ?Object, opts?: ?Object): void declare function isInterfaceDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceDeclaration) + declare function assertInterfaceDeclaration(node: ?Object, opts?: ?Object): void declare function isInterfaceTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceTypeAnnotation) + declare function assertInterfaceTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isIntersectionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIntersectionTypeAnnotation) + declare function assertIntersectionTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isMixedTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMixedTypeAnnotation) + declare function assertMixedTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isEmptyTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEmptyTypeAnnotation) + declare function assertEmptyTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isNullableTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullableTypeAnnotation) + declare function assertNullableTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isNumberLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumberLiteralTypeAnnotation) + declare function assertNumberLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isNumberTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumberTypeAnnotation) + declare function assertNumberTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isObjectTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeAnnotation) + declare function assertObjectTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isObjectTypeInternalSlot(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeInternalSlot) + declare function assertObjectTypeInternalSlot(node: ?Object, opts?: ?Object): void declare function isObjectTypeCallProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeCallProperty) + declare function assertObjectTypeCallProperty(node: ?Object, opts?: ?Object): void declare function isObjectTypeIndexer(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeIndexer) + declare function assertObjectTypeIndexer(node: ?Object, opts?: ?Object): void declare function isObjectTypeProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeProperty) + declare function assertObjectTypeProperty(node: ?Object, opts?: ?Object): void declare function isObjectTypeSpreadProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeSpreadProperty) + declare function assertObjectTypeSpreadProperty(node: ?Object, opts?: ?Object): void declare function isOpaqueType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOpaqueType) + declare function assertOpaqueType(node: ?Object, opts?: ?Object): void declare function isQualifiedTypeIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeQualifiedTypeIdentifier) + declare function assertQualifiedTypeIdentifier(node: ?Object, opts?: ?Object): void declare function isStringLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringLiteralTypeAnnotation) + declare function assertStringLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isStringTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringTypeAnnotation) + declare function assertStringTypeAnnotation(node: ?Object, opts?: ?Object): void + declare function isSymbolTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSymbolTypeAnnotation) + declare function assertSymbolTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isThisTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThisTypeAnnotation) + declare function assertThisTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isTupleTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTupleTypeAnnotation) + declare function assertTupleTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isTypeofTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeofTypeAnnotation) + declare function assertTypeofTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isTypeAlias(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeAlias) + declare function assertTypeAlias(node: ?Object, opts?: ?Object): void declare function isTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeAnnotation) + declare function assertTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isTypeCastExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeCastExpression) + declare function assertTypeCastExpression(node: ?Object, opts?: ?Object): void declare function isTypeParameter(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameter) + declare function assertTypeParameter(node: ?Object, opts?: ?Object): void declare function isTypeParameterDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameterDeclaration) + declare function assertTypeParameterDeclaration(node: ?Object, opts?: ?Object): void declare function isTypeParameterInstantiation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameterInstantiation) + declare function assertTypeParameterInstantiation(node: ?Object, opts?: ?Object): void declare function isUnionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUnionTypeAnnotation) + declare function assertUnionTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isVariance(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariance) + declare function assertVariance(node: ?Object, opts?: ?Object): void declare function isVoidTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVoidTypeAnnotation) + declare function assertVoidTypeAnnotation(node: ?Object, opts?: ?Object): void + declare function isEnumDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumDeclaration) + declare function assertEnumDeclaration(node: ?Object, opts?: ?Object): void + declare function isEnumBooleanBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumBooleanBody) + declare function assertEnumBooleanBody(node: ?Object, opts?: ?Object): void + declare function isEnumNumberBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumNumberBody) + declare function assertEnumNumberBody(node: ?Object, opts?: ?Object): void + declare function isEnumStringBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumStringBody) + declare function assertEnumStringBody(node: ?Object, opts?: ?Object): void + declare function isEnumSymbolBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumSymbolBody) + declare function assertEnumSymbolBody(node: ?Object, opts?: ?Object): void + declare function isEnumBooleanMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumBooleanMember) + declare function assertEnumBooleanMember(node: ?Object, opts?: ?Object): void + declare function isEnumNumberMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumNumberMember) + declare function assertEnumNumberMember(node: ?Object, opts?: ?Object): void + declare function isEnumStringMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumStringMember) + declare function assertEnumStringMember(node: ?Object, opts?: ?Object): void + declare function isEnumDefaultedMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumDefaultedMember) + declare function assertEnumDefaultedMember(node: ?Object, opts?: ?Object): void declare function isJSXAttribute(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXAttribute) + declare function assertJSXAttribute(node: ?Object, opts?: ?Object): void declare function isJSXClosingElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXClosingElement) + declare function assertJSXClosingElement(node: ?Object, opts?: ?Object): void declare function isJSXElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXElement) + declare function assertJSXElement(node: ?Object, opts?: ?Object): void declare function isJSXEmptyExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXEmptyExpression) + declare function assertJSXEmptyExpression(node: ?Object, opts?: ?Object): void declare function isJSXExpressionContainer(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXExpressionContainer) + declare function assertJSXExpressionContainer(node: ?Object, opts?: ?Object): void declare function isJSXSpreadChild(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXSpreadChild) + declare function assertJSXSpreadChild(node: ?Object, opts?: ?Object): void declare function isJSXIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXIdentifier) + declare function assertJSXIdentifier(node: ?Object, opts?: ?Object): void declare function isJSXMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXMemberExpression) + declare function assertJSXMemberExpression(node: ?Object, opts?: ?Object): void declare function isJSXNamespacedName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXNamespacedName) + declare function assertJSXNamespacedName(node: ?Object, opts?: ?Object): void declare function isJSXOpeningElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXOpeningElement) + declare function assertJSXOpeningElement(node: ?Object, opts?: ?Object): void declare function isJSXSpreadAttribute(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXSpreadAttribute) + declare function assertJSXSpreadAttribute(node: ?Object, opts?: ?Object): void declare function isJSXText(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXText) + declare function assertJSXText(node: ?Object, opts?: ?Object): void declare function isJSXFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXFragment) + declare function assertJSXFragment(node: ?Object, opts?: ?Object): void declare function isJSXOpeningFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXOpeningFragment) + declare function assertJSXOpeningFragment(node: ?Object, opts?: ?Object): void declare function isJSXClosingFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXClosingFragment) + declare function assertJSXClosingFragment(node: ?Object, opts?: ?Object): void declare function isNoop(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNoop) + declare function assertNoop(node: ?Object, opts?: ?Object): void declare function isPlaceholder(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePlaceholder) + declare function assertPlaceholder(node: ?Object, opts?: ?Object): void + declare function isV8IntrinsicIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeV8IntrinsicIdentifier) + declare function assertV8IntrinsicIdentifier(node: ?Object, opts?: ?Object): void declare function isArgumentPlaceholder(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArgumentPlaceholder) - declare function isAwaitExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAwaitExpression) + declare function assertArgumentPlaceholder(node: ?Object, opts?: ?Object): void declare function isBindExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBindExpression) + declare function assertBindExpression(node: ?Object, opts?: ?Object): void declare function isClassProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassProperty) - declare function isOptionalMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalMemberExpression) + declare function assertClassProperty(node: ?Object, opts?: ?Object): void declare function isPipelineTopicExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelineTopicExpression) + declare function assertPipelineTopicExpression(node: ?Object, opts?: ?Object): void declare function isPipelineBareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelineBareFunction) + declare function assertPipelineBareFunction(node: ?Object, opts?: ?Object): void declare function isPipelinePrimaryTopicReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelinePrimaryTopicReference) - declare function isOptionalCallExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalCallExpression) + declare function assertPipelinePrimaryTopicReference(node: ?Object, opts?: ?Object): void declare function isClassPrivateProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassPrivateProperty) + declare function assertClassPrivateProperty(node: ?Object, opts?: ?Object): void declare function isClassPrivateMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassPrivateMethod) - declare function isImport(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImport) + declare function assertClassPrivateMethod(node: ?Object, opts?: ?Object): void + declare function isImportAttribute(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportAttribute) + declare function assertImportAttribute(node: ?Object, opts?: ?Object): void declare function isDecorator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDecorator) + declare function assertDecorator(node: ?Object, opts?: ?Object): void declare function isDoExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDoExpression) + declare function assertDoExpression(node: ?Object, opts?: ?Object): void declare function isExportDefaultSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportDefaultSpecifier) - declare function isExportNamespaceSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportNamespaceSpecifier) + declare function assertExportDefaultSpecifier(node: ?Object, opts?: ?Object): void declare function isPrivateName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePrivateName) - declare function isBigIntLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBigIntLiteral) + declare function assertPrivateName(node: ?Object, opts?: ?Object): void + declare function isRecordExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRecordExpression) + declare function assertRecordExpression(node: ?Object, opts?: ?Object): void + declare function isTupleExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTupleExpression) + declare function assertTupleExpression(node: ?Object, opts?: ?Object): void + declare function isDecimalLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDecimalLiteral) + declare function assertDecimalLiteral(node: ?Object, opts?: ?Object): void + declare function isStaticBlock(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStaticBlock) + declare function assertStaticBlock(node: ?Object, opts?: ?Object): void declare function isTSParameterProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSParameterProperty) + declare function assertTSParameterProperty(node: ?Object, opts?: ?Object): void declare function isTSDeclareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSDeclareFunction) + declare function assertTSDeclareFunction(node: ?Object, opts?: ?Object): void declare function isTSDeclareMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSDeclareMethod) + declare function assertTSDeclareMethod(node: ?Object, opts?: ?Object): void declare function isTSQualifiedName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSQualifiedName) + declare function assertTSQualifiedName(node: ?Object, opts?: ?Object): void declare function isTSCallSignatureDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSCallSignatureDeclaration) + declare function assertTSCallSignatureDeclaration(node: ?Object, opts?: ?Object): void declare function isTSConstructSignatureDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConstructSignatureDeclaration) + declare function assertTSConstructSignatureDeclaration(node: ?Object, opts?: ?Object): void declare function isTSPropertySignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSPropertySignature) + declare function assertTSPropertySignature(node: ?Object, opts?: ?Object): void declare function isTSMethodSignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSMethodSignature) + declare function assertTSMethodSignature(node: ?Object, opts?: ?Object): void declare function isTSIndexSignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIndexSignature) + declare function assertTSIndexSignature(node: ?Object, opts?: ?Object): void declare function isTSAnyKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSAnyKeyword) - declare function isTSUnknownKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUnknownKeyword) + declare function assertTSAnyKeyword(node: ?Object, opts?: ?Object): void + declare function isTSBooleanKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSBooleanKeyword) + declare function assertTSBooleanKeyword(node: ?Object, opts?: ?Object): void + declare function isTSBigIntKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSBigIntKeyword) + declare function assertTSBigIntKeyword(node: ?Object, opts?: ?Object): void + declare function isTSIntrinsicKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIntrinsicKeyword) + declare function assertTSIntrinsicKeyword(node: ?Object, opts?: ?Object): void + declare function isTSNeverKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNeverKeyword) + declare function assertTSNeverKeyword(node: ?Object, opts?: ?Object): void + declare function isTSNullKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNullKeyword) + declare function assertTSNullKeyword(node: ?Object, opts?: ?Object): void declare function isTSNumberKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNumberKeyword) + declare function assertTSNumberKeyword(node: ?Object, opts?: ?Object): void declare function isTSObjectKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSObjectKeyword) - declare function isTSBooleanKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSBooleanKeyword) + declare function assertTSObjectKeyword(node: ?Object, opts?: ?Object): void declare function isTSStringKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSStringKeyword) + declare function assertTSStringKeyword(node: ?Object, opts?: ?Object): void declare function isTSSymbolKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSSymbolKeyword) - declare function isTSVoidKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSVoidKeyword) + declare function assertTSSymbolKeyword(node: ?Object, opts?: ?Object): void declare function isTSUndefinedKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUndefinedKeyword) - declare function isTSNullKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNullKeyword) - declare function isTSNeverKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNeverKeyword) + declare function assertTSUndefinedKeyword(node: ?Object, opts?: ?Object): void + declare function isTSUnknownKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUnknownKeyword) + declare function assertTSUnknownKeyword(node: ?Object, opts?: ?Object): void + declare function isTSVoidKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSVoidKeyword) + declare function assertTSVoidKeyword(node: ?Object, opts?: ?Object): void declare function isTSThisType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSThisType) + declare function assertTSThisType(node: ?Object, opts?: ?Object): void declare function isTSFunctionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSFunctionType) + declare function assertTSFunctionType(node: ?Object, opts?: ?Object): void declare function isTSConstructorType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConstructorType) + declare function assertTSConstructorType(node: ?Object, opts?: ?Object): void declare function isTSTypeReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeReference) + declare function assertTSTypeReference(node: ?Object, opts?: ?Object): void declare function isTSTypePredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypePredicate) + declare function assertTSTypePredicate(node: ?Object, opts?: ?Object): void declare function isTSTypeQuery(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeQuery) + declare function assertTSTypeQuery(node: ?Object, opts?: ?Object): void declare function isTSTypeLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeLiteral) + declare function assertTSTypeLiteral(node: ?Object, opts?: ?Object): void declare function isTSArrayType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSArrayType) + declare function assertTSArrayType(node: ?Object, opts?: ?Object): void declare function isTSTupleType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTupleType) + declare function assertTSTupleType(node: ?Object, opts?: ?Object): void declare function isTSOptionalType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSOptionalType) + declare function assertTSOptionalType(node: ?Object, opts?: ?Object): void declare function isTSRestType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSRestType) + declare function assertTSRestType(node: ?Object, opts?: ?Object): void + declare function isTSNamedTupleMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNamedTupleMember) + declare function assertTSNamedTupleMember(node: ?Object, opts?: ?Object): void declare function isTSUnionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUnionType) + declare function assertTSUnionType(node: ?Object, opts?: ?Object): void declare function isTSIntersectionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIntersectionType) + declare function assertTSIntersectionType(node: ?Object, opts?: ?Object): void declare function isTSConditionalType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConditionalType) + declare function assertTSConditionalType(node: ?Object, opts?: ?Object): void declare function isTSInferType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInferType) + declare function assertTSInferType(node: ?Object, opts?: ?Object): void declare function isTSParenthesizedType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSParenthesizedType) + declare function assertTSParenthesizedType(node: ?Object, opts?: ?Object): void declare function isTSTypeOperator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeOperator) + declare function assertTSTypeOperator(node: ?Object, opts?: ?Object): void declare function isTSIndexedAccessType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIndexedAccessType) + declare function assertTSIndexedAccessType(node: ?Object, opts?: ?Object): void declare function isTSMappedType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSMappedType) + declare function assertTSMappedType(node: ?Object, opts?: ?Object): void declare function isTSLiteralType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSLiteralType) + declare function assertTSLiteralType(node: ?Object, opts?: ?Object): void declare function isTSExpressionWithTypeArguments(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExpressionWithTypeArguments) + declare function assertTSExpressionWithTypeArguments(node: ?Object, opts?: ?Object): void declare function isTSInterfaceDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInterfaceDeclaration) + declare function assertTSInterfaceDeclaration(node: ?Object, opts?: ?Object): void declare function isTSInterfaceBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInterfaceBody) + declare function assertTSInterfaceBody(node: ?Object, opts?: ?Object): void declare function isTSTypeAliasDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAliasDeclaration) + declare function assertTSTypeAliasDeclaration(node: ?Object, opts?: ?Object): void declare function isTSAsExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSAsExpression) + declare function assertTSAsExpression(node: ?Object, opts?: ?Object): void declare function isTSTypeAssertion(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAssertion) + declare function assertTSTypeAssertion(node: ?Object, opts?: ?Object): void declare function isTSEnumDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSEnumDeclaration) + declare function assertTSEnumDeclaration(node: ?Object, opts?: ?Object): void declare function isTSEnumMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSEnumMember) + declare function assertTSEnumMember(node: ?Object, opts?: ?Object): void declare function isTSModuleDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSModuleDeclaration) + declare function assertTSModuleDeclaration(node: ?Object, opts?: ?Object): void declare function isTSModuleBlock(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSModuleBlock) + declare function assertTSModuleBlock(node: ?Object, opts?: ?Object): void declare function isTSImportType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSImportType) + declare function assertTSImportType(node: ?Object, opts?: ?Object): void declare function isTSImportEqualsDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSImportEqualsDeclaration) + declare function assertTSImportEqualsDeclaration(node: ?Object, opts?: ?Object): void declare function isTSExternalModuleReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExternalModuleReference) + declare function assertTSExternalModuleReference(node: ?Object, opts?: ?Object): void declare function isTSNonNullExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNonNullExpression) + declare function assertTSNonNullExpression(node: ?Object, opts?: ?Object): void declare function isTSExportAssignment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExportAssignment) + declare function assertTSExportAssignment(node: ?Object, opts?: ?Object): void declare function isTSNamespaceExportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNamespaceExportDeclaration) + declare function assertTSNamespaceExportDeclaration(node: ?Object, opts?: ?Object): void declare function isTSTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAnnotation) + declare function assertTSTypeAnnotation(node: ?Object, opts?: ?Object): void declare function isTSTypeParameterInstantiation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameterInstantiation) + declare function assertTSTypeParameterInstantiation(node: ?Object, opts?: ?Object): void declare function isTSTypeParameterDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameterDeclaration) + declare function assertTSTypeParameterDeclaration(node: ?Object, opts?: ?Object): void declare function isTSTypeParameter(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameter) + declare function assertTSTypeParameter(node: ?Object, opts?: ?Object): void declare function isExpression(node: ?Object, opts?: ?Object): boolean + declare function assertExpression(node: ?Object, opts?: ?Object): void declare function isBinary(node: ?Object, opts?: ?Object): boolean + declare function assertBinary(node: ?Object, opts?: ?Object): void declare function isScopable(node: ?Object, opts?: ?Object): boolean + declare function assertScopable(node: ?Object, opts?: ?Object): void declare function isBlockParent(node: ?Object, opts?: ?Object): boolean + declare function assertBlockParent(node: ?Object, opts?: ?Object): void declare function isBlock(node: ?Object, opts?: ?Object): boolean + declare function assertBlock(node: ?Object, opts?: ?Object): void declare function isStatement(node: ?Object, opts?: ?Object): boolean + declare function assertStatement(node: ?Object, opts?: ?Object): void declare function isTerminatorless(node: ?Object, opts?: ?Object): boolean + declare function assertTerminatorless(node: ?Object, opts?: ?Object): void declare function isCompletionStatement(node: ?Object, opts?: ?Object): boolean + declare function assertCompletionStatement(node: ?Object, opts?: ?Object): void declare function isConditional(node: ?Object, opts?: ?Object): boolean + declare function assertConditional(node: ?Object, opts?: ?Object): void declare function isLoop(node: ?Object, opts?: ?Object): boolean + declare function assertLoop(node: ?Object, opts?: ?Object): void declare function isWhile(node: ?Object, opts?: ?Object): boolean + declare function assertWhile(node: ?Object, opts?: ?Object): void declare function isExpressionWrapper(node: ?Object, opts?: ?Object): boolean + declare function assertExpressionWrapper(node: ?Object, opts?: ?Object): void declare function isFor(node: ?Object, opts?: ?Object): boolean + declare function assertFor(node: ?Object, opts?: ?Object): void declare function isForXStatement(node: ?Object, opts?: ?Object): boolean + declare function assertForXStatement(node: ?Object, opts?: ?Object): void declare function isFunction(node: ?Object, opts?: ?Object): boolean + declare function assertFunction(node: ?Object, opts?: ?Object): void declare function isFunctionParent(node: ?Object, opts?: ?Object): boolean + declare function assertFunctionParent(node: ?Object, opts?: ?Object): void declare function isPureish(node: ?Object, opts?: ?Object): boolean + declare function assertPureish(node: ?Object, opts?: ?Object): void declare function isDeclaration(node: ?Object, opts?: ?Object): boolean + declare function assertDeclaration(node: ?Object, opts?: ?Object): void declare function isPatternLike(node: ?Object, opts?: ?Object): boolean + declare function assertPatternLike(node: ?Object, opts?: ?Object): void declare function isLVal(node: ?Object, opts?: ?Object): boolean + declare function assertLVal(node: ?Object, opts?: ?Object): void declare function isTSEntityName(node: ?Object, opts?: ?Object): boolean + declare function assertTSEntityName(node: ?Object, opts?: ?Object): void declare function isLiteral(node: ?Object, opts?: ?Object): boolean + declare function assertLiteral(node: ?Object, opts?: ?Object): void declare function isImmutable(node: ?Object, opts?: ?Object): boolean + declare function assertImmutable(node: ?Object, opts?: ?Object): void declare function isUserWhitespacable(node: ?Object, opts?: ?Object): boolean + declare function assertUserWhitespacable(node: ?Object, opts?: ?Object): void declare function isMethod(node: ?Object, opts?: ?Object): boolean + declare function assertMethod(node: ?Object, opts?: ?Object): void declare function isObjectMember(node: ?Object, opts?: ?Object): boolean + declare function assertObjectMember(node: ?Object, opts?: ?Object): void declare function isProperty(node: ?Object, opts?: ?Object): boolean + declare function assertProperty(node: ?Object, opts?: ?Object): void declare function isUnaryLike(node: ?Object, opts?: ?Object): boolean + declare function assertUnaryLike(node: ?Object, opts?: ?Object): void declare function isPattern(node: ?Object, opts?: ?Object): boolean + declare function assertPattern(node: ?Object, opts?: ?Object): void declare function isClass(node: ?Object, opts?: ?Object): boolean + declare function assertClass(node: ?Object, opts?: ?Object): void declare function isModuleDeclaration(node: ?Object, opts?: ?Object): boolean + declare function assertModuleDeclaration(node: ?Object, opts?: ?Object): void declare function isExportDeclaration(node: ?Object, opts?: ?Object): boolean + declare function assertExportDeclaration(node: ?Object, opts?: ?Object): void declare function isModuleSpecifier(node: ?Object, opts?: ?Object): boolean + declare function assertModuleSpecifier(node: ?Object, opts?: ?Object): void declare function isFlow(node: ?Object, opts?: ?Object): boolean + declare function assertFlow(node: ?Object, opts?: ?Object): void declare function isFlowType(node: ?Object, opts?: ?Object): boolean + declare function assertFlowType(node: ?Object, opts?: ?Object): void declare function isFlowBaseAnnotation(node: ?Object, opts?: ?Object): boolean + declare function assertFlowBaseAnnotation(node: ?Object, opts?: ?Object): void declare function isFlowDeclaration(node: ?Object, opts?: ?Object): boolean + declare function assertFlowDeclaration(node: ?Object, opts?: ?Object): void declare function isFlowPredicate(node: ?Object, opts?: ?Object): boolean + declare function assertFlowPredicate(node: ?Object, opts?: ?Object): void + declare function isEnumBody(node: ?Object, opts?: ?Object): boolean + declare function assertEnumBody(node: ?Object, opts?: ?Object): void + declare function isEnumMember(node: ?Object, opts?: ?Object): boolean + declare function assertEnumMember(node: ?Object, opts?: ?Object): void declare function isJSX(node: ?Object, opts?: ?Object): boolean + declare function assertJSX(node: ?Object, opts?: ?Object): void declare function isPrivate(node: ?Object, opts?: ?Object): boolean + declare function assertPrivate(node: ?Object, opts?: ?Object): void declare function isTSTypeElement(node: ?Object, opts?: ?Object): boolean + declare function assertTSTypeElement(node: ?Object, opts?: ?Object): void declare function isTSType(node: ?Object, opts?: ?Object): boolean - declare function isNumberLiteral(node: ?Object, opts?: ?Object): boolean - declare function isRegexLiteral(node: ?Object, opts?: ?Object): boolean - declare function isRestProperty(node: ?Object, opts?: ?Object): boolean - declare function isSpreadProperty(node: ?Object, opts?: ?Object): boolean - declare function validate(n: BabelNode, key: string, value: mixed): void; + declare function assertTSType(node: ?Object, opts?: ?Object): void + declare function isTSBaseType(node: ?Object, opts?: ?Object): boolean + declare function assertTSBaseType(node: ?Object, opts?: ?Object): void + declare function isNumberLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumericLiteral) + declare function assertNumberLiteral(node: ?Object, opts?: ?Object): void + declare function isRegexLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRegExpLiteral) + declare function assertRegexLiteral(node: ?Object, opts?: ?Object): void + declare function isRestProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRestElement) + declare function assertRestProperty(node: ?Object, opts?: ?Object): void + declare function isSpreadProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSpreadElement) + declare function assertSpreadProperty(node: ?Object, opts?: ?Object): void + declare function assertNode(obj: any): void + declare function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): BabelNodeTypeAnnotation + declare function createUnionTypeAnnotation(types: Array): BabelNodeUnionTypeAnnotation + declare function createFlowUnionType(types: Array): BabelNodeUnionTypeAnnotation + declare function buildChildren(node: { children: Array }): Array declare function clone(n: T): T; declare function cloneDeep(n: T): T; + declare function cloneDeepWithoutLoc(n: T): T; + declare function cloneNode(n: T, deep?: boolean, withoutLoc?: boolean): T; + declare function cloneWithoutLoc(n: T): T; + declare type CommentTypeShorthand = 'leading' | 'inner' | 'trailing' + declare function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T + declare function addComments(node: T, type: CommentTypeShorthand, comments: Array): T + declare function inheritInnerComments(node: Node, parent: Node): void + declare function inheritLeadingComments(node: Node, parent: Node): void + declare function inheritsComments(node: T, parent: Node): void + declare function inheritTrailingComments(node: Node, parent: Node): void + declare function removeComments(node: T): T + declare function ensureBlock(node: BabelNode, key: string): BabelNodeBlockStatement + declare function toBindingIdentifierName(name?: ?string): string + declare function toBlock(node: BabelNodeStatement | BabelNodeExpression, parent?: BabelNodeFunction | null): BabelNodeBlockStatement + declare function toComputedKey(node: BabelNodeMethod | BabelNodeProperty, key?: BabelNodeExpression | BabelNodeIdentifier): BabelNodeExpression + declare function toExpression(node: BabelNodeExpressionStatement | BabelNodeExpression | BabelNodeClass | BabelNodeFunction): BabelNodeExpression + declare function toIdentifier(name?: ?string): string + declare function toKeyAlias(node: BabelNodeMethod | BabelNodeProperty, key?: BabelNode): string + declare function toStatement(node: BabelNodeStatement | BabelNodeClass | BabelNodeFunction | BabelNodeAssignmentExpression, ignore?: boolean): BabelNodeStatement | void + declare function valueToNode(value: any): BabelNodeExpression + declare function removeTypeDuplicates(types: Array): Array + declare function appendToMemberExpression(member: BabelNodeMemberExpression, append: BabelNode, computed?: boolean): BabelNodeMemberExpression + declare function inherits(child: T, parent: BabelNode | null | void): T + declare function prependToMemberExpression(member: BabelNodeMemberExpression, prepend: BabelNodeExpression): BabelNodeMemberExpression declare function removeProperties(n: T, opts: ?{}): void; declare function removePropertiesDeep(n: T, opts: ?{}): T; + declare function getBindingIdentifiers(node: BabelNode, duplicates: boolean, outerOnly?: boolean): { [key: string]: BabelNodeIdentifier | Array } + declare function getOuterBindingIdentifiers(node: Node, duplicates: boolean): { [key: string]: BabelNodeIdentifier | Array } declare type TraversalAncestors = Array<{ node: BabelNode, key: string, @@ -1972,4 +2451,25 @@ declare module "@babel/types" { exit?: TraversalHandler, }; declare function traverse(n: BabelNode, TraversalHandler | TraversalHandlers, state?: T): void; + declare function traverseFast(n: Node, h: TraversalHandler, state?: T): void; + declare function shallowEqual(actual: Object, expected: Object): boolean + declare function buildMatchMemberExpression(match: string, allowPartial?: boolean): (?BabelNode) => boolean + declare function is(type: string, n: BabelNode, opts: Object): boolean; + declare function isBinding(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean + declare function isBlockScoped(node: BabelNode): boolean + declare function isImmutable(node: BabelNode): boolean + declare function isLet(node: BabelNode): boolean + declare function isNode(node: ?Object): boolean + declare function isNodesEquivalent(a: any, b: any): boolean + declare function isPlaceholderType(placeholderType: string, targetType: string): boolean + declare function isReferenced(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean + declare function isScope(node: BabelNode, parent: BabelNode): boolean + declare function isSpecifierDefault(specifier: BabelNodeModuleSpecifier): boolean + declare function isType(nodetype: ?string, targetType: string): boolean + declare function isValidES3Identifier(name: string): boolean + declare function isValidES3Identifier(name: string): boolean + declare function isValidIdentifier(name: string): boolean + declare function isVar(node: BabelNode): boolean + declare function matchesPattern(node: ?BabelNode, match: string | Array, allowPartial?: boolean): boolean + declare function validate(n: BabelNode, key: string, value: mixed): void; } diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/inherits.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/inherits.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/inherits.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/inherits.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removeProperties.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/removeProperties.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removeProperties.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/removeProperties.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js new file mode 100644 index 00000000000000..5eca7e1f488bf3 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js @@ -0,0 +1,54 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = removeTypeDuplicates; + +var _generated = require("../../validators/generated"); + +function removeTypeDuplicates(nodes) { + const generics = {}; + const bases = {}; + const typeGroups = []; + const types = []; + + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (!node) continue; + + if (types.indexOf(node) >= 0) { + continue; + } + + if ((0, _generated.isTSAnyKeyword)(node.type)) { + return [node]; + } + + if ((0, _generated.isTSBaseType)(node)) { + bases[node.type] = node; + continue; + } + + if ((0, _generated.isTSUnionType)(node)) { + if (typeGroups.indexOf(node.types) < 0) { + nodes = nodes.concat(node.types); + typeGroups.push(node.types); + } + + continue; + } + + types.push(node); + } + + for (const type of Object.keys(bases)) { + types.push(bases[type]); + } + + for (const name of Object.keys(generics)) { + types.push(generics[name]); + } + + return types; +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverse.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/traverse/traverse.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverse.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/traverse/traverse.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverseFast.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/traverse/traverseFast.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/traverse/traverseFast.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/traverse/traverseFast.js diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/lib/utils/inherit.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/utils/inherit.js new file mode 100644 index 00000000000000..35f338124395a9 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/utils/inherit.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = inherit; + +function inherit(key, child, parent) { + if (child && parent) { + child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean))); + } +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/shallowEqual.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/utils/shallowEqual.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/shallowEqual.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/utils/shallowEqual.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/generated/index.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/generated/index.js similarity index 88% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/generated/index.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/generated/index.js index 24ffceb446e08f..7978b63fa28492 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/generated/index.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/generated/index.js @@ -58,8 +58,8 @@ exports.isAssignmentPattern = isAssignmentPattern; exports.isArrayPattern = isArrayPattern; exports.isArrowFunctionExpression = isArrowFunctionExpression; exports.isClassBody = isClassBody; -exports.isClassDeclaration = isClassDeclaration; exports.isClassExpression = isClassExpression; +exports.isClassDeclaration = isClassDeclaration; exports.isExportAllDeclaration = isExportAllDeclaration; exports.isExportDefaultDeclaration = isExportDefaultDeclaration; exports.isExportNamedDeclaration = isExportNamedDeclaration; @@ -78,6 +78,12 @@ exports.isTaggedTemplateExpression = isTaggedTemplateExpression; exports.isTemplateElement = isTemplateElement; exports.isTemplateLiteral = isTemplateLiteral; exports.isYieldExpression = isYieldExpression; +exports.isAwaitExpression = isAwaitExpression; +exports.isImport = isImport; +exports.isBigIntLiteral = isBigIntLiteral; +exports.isExportNamespaceSpecifier = isExportNamespaceSpecifier; +exports.isOptionalMemberExpression = isOptionalMemberExpression; +exports.isOptionalCallExpression = isOptionalCallExpression; exports.isAnyTypeAnnotation = isAnyTypeAnnotation; exports.isArrayTypeAnnotation = isArrayTypeAnnotation; exports.isBooleanTypeAnnotation = isBooleanTypeAnnotation; @@ -119,6 +125,7 @@ exports.isOpaqueType = isOpaqueType; exports.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier; exports.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation; exports.isStringTypeAnnotation = isStringTypeAnnotation; +exports.isSymbolTypeAnnotation = isSymbolTypeAnnotation; exports.isThisTypeAnnotation = isThisTypeAnnotation; exports.isTupleTypeAnnotation = isTupleTypeAnnotation; exports.isTypeofTypeAnnotation = isTypeofTypeAnnotation; @@ -131,6 +138,15 @@ exports.isTypeParameterInstantiation = isTypeParameterInstantiation; exports.isUnionTypeAnnotation = isUnionTypeAnnotation; exports.isVariance = isVariance; exports.isVoidTypeAnnotation = isVoidTypeAnnotation; +exports.isEnumDeclaration = isEnumDeclaration; +exports.isEnumBooleanBody = isEnumBooleanBody; +exports.isEnumNumberBody = isEnumNumberBody; +exports.isEnumStringBody = isEnumStringBody; +exports.isEnumSymbolBody = isEnumSymbolBody; +exports.isEnumBooleanMember = isEnumBooleanMember; +exports.isEnumNumberMember = isEnumNumberMember; +exports.isEnumStringMember = isEnumStringMember; +exports.isEnumDefaultedMember = isEnumDefaultedMember; exports.isJSXAttribute = isJSXAttribute; exports.isJSXClosingElement = isJSXClosingElement; exports.isJSXElement = isJSXElement; @@ -148,24 +164,24 @@ exports.isJSXOpeningFragment = isJSXOpeningFragment; exports.isJSXClosingFragment = isJSXClosingFragment; exports.isNoop = isNoop; exports.isPlaceholder = isPlaceholder; +exports.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier; exports.isArgumentPlaceholder = isArgumentPlaceholder; -exports.isAwaitExpression = isAwaitExpression; exports.isBindExpression = isBindExpression; exports.isClassProperty = isClassProperty; -exports.isOptionalMemberExpression = isOptionalMemberExpression; exports.isPipelineTopicExpression = isPipelineTopicExpression; exports.isPipelineBareFunction = isPipelineBareFunction; exports.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference; -exports.isOptionalCallExpression = isOptionalCallExpression; exports.isClassPrivateProperty = isClassPrivateProperty; exports.isClassPrivateMethod = isClassPrivateMethod; -exports.isImport = isImport; +exports.isImportAttribute = isImportAttribute; exports.isDecorator = isDecorator; exports.isDoExpression = isDoExpression; exports.isExportDefaultSpecifier = isExportDefaultSpecifier; -exports.isExportNamespaceSpecifier = isExportNamespaceSpecifier; exports.isPrivateName = isPrivateName; -exports.isBigIntLiteral = isBigIntLiteral; +exports.isRecordExpression = isRecordExpression; +exports.isTupleExpression = isTupleExpression; +exports.isDecimalLiteral = isDecimalLiteral; +exports.isStaticBlock = isStaticBlock; exports.isTSParameterProperty = isTSParameterProperty; exports.isTSDeclareFunction = isTSDeclareFunction; exports.isTSDeclareMethod = isTSDeclareMethod; @@ -176,16 +192,18 @@ exports.isTSPropertySignature = isTSPropertySignature; exports.isTSMethodSignature = isTSMethodSignature; exports.isTSIndexSignature = isTSIndexSignature; exports.isTSAnyKeyword = isTSAnyKeyword; -exports.isTSUnknownKeyword = isTSUnknownKeyword; +exports.isTSBooleanKeyword = isTSBooleanKeyword; +exports.isTSBigIntKeyword = isTSBigIntKeyword; +exports.isTSIntrinsicKeyword = isTSIntrinsicKeyword; +exports.isTSNeverKeyword = isTSNeverKeyword; +exports.isTSNullKeyword = isTSNullKeyword; exports.isTSNumberKeyword = isTSNumberKeyword; exports.isTSObjectKeyword = isTSObjectKeyword; -exports.isTSBooleanKeyword = isTSBooleanKeyword; exports.isTSStringKeyword = isTSStringKeyword; exports.isTSSymbolKeyword = isTSSymbolKeyword; -exports.isTSVoidKeyword = isTSVoidKeyword; exports.isTSUndefinedKeyword = isTSUndefinedKeyword; -exports.isTSNullKeyword = isTSNullKeyword; -exports.isTSNeverKeyword = isTSNeverKeyword; +exports.isTSUnknownKeyword = isTSUnknownKeyword; +exports.isTSVoidKeyword = isTSVoidKeyword; exports.isTSThisType = isTSThisType; exports.isTSFunctionType = isTSFunctionType; exports.isTSConstructorType = isTSConstructorType; @@ -197,6 +215,7 @@ exports.isTSArrayType = isTSArrayType; exports.isTSTupleType = isTSTupleType; exports.isTSOptionalType = isTSOptionalType; exports.isTSRestType = isTSRestType; +exports.isTSNamedTupleMember = isTSNamedTupleMember; exports.isTSUnionType = isTSUnionType; exports.isTSIntersectionType = isTSIntersectionType; exports.isTSConditionalType = isTSConditionalType; @@ -264,10 +283,13 @@ exports.isFlowType = isFlowType; exports.isFlowBaseAnnotation = isFlowBaseAnnotation; exports.isFlowDeclaration = isFlowDeclaration; exports.isFlowPredicate = isFlowPredicate; +exports.isEnumBody = isEnumBody; +exports.isEnumMember = isEnumMember; exports.isJSX = isJSX; exports.isPrivate = isPrivate; exports.isTSTypeElement = isTSTypeElement; exports.isTSType = isTSType; +exports.isTSBaseType = isTSBaseType; exports.isNumberLiteral = isNumberLiteral; exports.isRegexLiteral = isRegexLiteral; exports.isRestProperty = isRestProperty; @@ -1102,11 +1124,11 @@ function isClassBody(node, opts) { return false; } -function isClassDeclaration(node, opts) { +function isClassExpression(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "ClassDeclaration") { + if (nodeType === "ClassExpression") { if (typeof opts === "undefined") { return true; } else { @@ -1117,11 +1139,11 @@ function isClassDeclaration(node, opts) { return false; } -function isClassExpression(node, opts) { +function isClassDeclaration(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "ClassExpression") { + if (nodeType === "ClassDeclaration") { if (typeof opts === "undefined") { return true; } else { @@ -1402,6 +1424,96 @@ function isYieldExpression(node, opts) { return false; } +function isAwaitExpression(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "AwaitExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isImport(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "Import") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isBigIntLiteral(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "BigIntLiteral") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isExportNamespaceSpecifier(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "ExportNamespaceSpecifier") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isOptionalMemberExpression(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "OptionalMemberExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isOptionalCallExpression(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "OptionalCallExpression") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + function isAnyTypeAnnotation(node, opts) { if (!node) return false; const nodeType = node.type; @@ -2017,6 +2129,21 @@ function isStringTypeAnnotation(node, opts) { return false; } +function isSymbolTypeAnnotation(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "SymbolTypeAnnotation") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + function isThisTypeAnnotation(node, opts) { if (!node) return false; const nodeType = node.type; @@ -2197,6 +2324,141 @@ function isVoidTypeAnnotation(node, opts) { return false; } +function isEnumDeclaration(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EnumDeclaration") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isEnumBooleanBody(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EnumBooleanBody") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isEnumNumberBody(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EnumNumberBody") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isEnumStringBody(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EnumStringBody") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isEnumSymbolBody(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EnumSymbolBody") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isEnumBooleanMember(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EnumBooleanMember") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isEnumNumberMember(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EnumNumberMember") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isEnumStringMember(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EnumStringMember") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isEnumDefaultedMember(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EnumDefaultedMember") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + function isJSXAttribute(node, opts) { if (!node) return false; const nodeType = node.type; @@ -2452,11 +2714,11 @@ function isPlaceholder(node, opts) { return false; } -function isArgumentPlaceholder(node, opts) { +function isV8IntrinsicIdentifier(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "ArgumentPlaceholder") { + if (nodeType === "V8IntrinsicIdentifier") { if (typeof opts === "undefined") { return true; } else { @@ -2467,11 +2729,11 @@ function isArgumentPlaceholder(node, opts) { return false; } -function isAwaitExpression(node, opts) { +function isArgumentPlaceholder(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "AwaitExpression") { + if (nodeType === "ArgumentPlaceholder") { if (typeof opts === "undefined") { return true; } else { @@ -2512,11 +2774,11 @@ function isClassProperty(node, opts) { return false; } -function isOptionalMemberExpression(node, opts) { +function isPipelineTopicExpression(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "OptionalMemberExpression") { + if (nodeType === "PipelineTopicExpression") { if (typeof opts === "undefined") { return true; } else { @@ -2527,11 +2789,11 @@ function isOptionalMemberExpression(node, opts) { return false; } -function isPipelineTopicExpression(node, opts) { +function isPipelineBareFunction(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "PipelineTopicExpression") { + if (nodeType === "PipelineBareFunction") { if (typeof opts === "undefined") { return true; } else { @@ -2542,11 +2804,11 @@ function isPipelineTopicExpression(node, opts) { return false; } -function isPipelineBareFunction(node, opts) { +function isPipelinePrimaryTopicReference(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "PipelineBareFunction") { + if (nodeType === "PipelinePrimaryTopicReference") { if (typeof opts === "undefined") { return true; } else { @@ -2557,11 +2819,11 @@ function isPipelineBareFunction(node, opts) { return false; } -function isPipelinePrimaryTopicReference(node, opts) { +function isClassPrivateProperty(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "PipelinePrimaryTopicReference") { + if (nodeType === "ClassPrivateProperty") { if (typeof opts === "undefined") { return true; } else { @@ -2572,11 +2834,11 @@ function isPipelinePrimaryTopicReference(node, opts) { return false; } -function isOptionalCallExpression(node, opts) { +function isClassPrivateMethod(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "OptionalCallExpression") { + if (nodeType === "ClassPrivateMethod") { if (typeof opts === "undefined") { return true; } else { @@ -2587,11 +2849,11 @@ function isOptionalCallExpression(node, opts) { return false; } -function isClassPrivateProperty(node, opts) { +function isImportAttribute(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "ClassPrivateProperty") { + if (nodeType === "ImportAttribute") { if (typeof opts === "undefined") { return true; } else { @@ -2602,11 +2864,11 @@ function isClassPrivateProperty(node, opts) { return false; } -function isClassPrivateMethod(node, opts) { +function isDecorator(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "ClassPrivateMethod") { + if (nodeType === "Decorator") { if (typeof opts === "undefined") { return true; } else { @@ -2617,11 +2879,11 @@ function isClassPrivateMethod(node, opts) { return false; } -function isImport(node, opts) { +function isDoExpression(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Import") { + if (nodeType === "DoExpression") { if (typeof opts === "undefined") { return true; } else { @@ -2632,11 +2894,11 @@ function isImport(node, opts) { return false; } -function isDecorator(node, opts) { +function isExportDefaultSpecifier(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Decorator") { + if (nodeType === "ExportDefaultSpecifier") { if (typeof opts === "undefined") { return true; } else { @@ -2647,11 +2909,11 @@ function isDecorator(node, opts) { return false; } -function isDoExpression(node, opts) { +function isPrivateName(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "DoExpression") { + if (nodeType === "PrivateName") { if (typeof opts === "undefined") { return true; } else { @@ -2662,11 +2924,11 @@ function isDoExpression(node, opts) { return false; } -function isExportDefaultSpecifier(node, opts) { +function isRecordExpression(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "ExportDefaultSpecifier") { + if (nodeType === "RecordExpression") { if (typeof opts === "undefined") { return true; } else { @@ -2677,11 +2939,11 @@ function isExportDefaultSpecifier(node, opts) { return false; } -function isExportNamespaceSpecifier(node, opts) { +function isTupleExpression(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "ExportNamespaceSpecifier") { + if (nodeType === "TupleExpression") { if (typeof opts === "undefined") { return true; } else { @@ -2692,11 +2954,11 @@ function isExportNamespaceSpecifier(node, opts) { return false; } -function isPrivateName(node, opts) { +function isDecimalLiteral(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "PrivateName") { + if (nodeType === "DecimalLiteral") { if (typeof opts === "undefined") { return true; } else { @@ -2707,11 +2969,11 @@ function isPrivateName(node, opts) { return false; } -function isBigIntLiteral(node, opts) { +function isStaticBlock(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "BigIntLiteral") { + if (nodeType === "StaticBlock") { if (typeof opts === "undefined") { return true; } else { @@ -2872,11 +3134,11 @@ function isTSAnyKeyword(node, opts) { return false; } -function isTSUnknownKeyword(node, opts) { +function isTSBooleanKeyword(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSUnknownKeyword") { + if (nodeType === "TSBooleanKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2887,11 +3149,11 @@ function isTSUnknownKeyword(node, opts) { return false; } -function isTSNumberKeyword(node, opts) { +function isTSBigIntKeyword(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSNumberKeyword") { + if (nodeType === "TSBigIntKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2902,11 +3164,11 @@ function isTSNumberKeyword(node, opts) { return false; } -function isTSObjectKeyword(node, opts) { +function isTSIntrinsicKeyword(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSObjectKeyword") { + if (nodeType === "TSIntrinsicKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2917,11 +3179,11 @@ function isTSObjectKeyword(node, opts) { return false; } -function isTSBooleanKeyword(node, opts) { +function isTSNeverKeyword(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSBooleanKeyword") { + if (nodeType === "TSNeverKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2932,11 +3194,11 @@ function isTSBooleanKeyword(node, opts) { return false; } -function isTSStringKeyword(node, opts) { +function isTSNullKeyword(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSStringKeyword") { + if (nodeType === "TSNullKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2947,11 +3209,11 @@ function isTSStringKeyword(node, opts) { return false; } -function isTSSymbolKeyword(node, opts) { +function isTSNumberKeyword(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSSymbolKeyword") { + if (nodeType === "TSNumberKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2962,11 +3224,41 @@ function isTSSymbolKeyword(node, opts) { return false; } -function isTSVoidKeyword(node, opts) { +function isTSObjectKeyword(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSVoidKeyword") { + if (nodeType === "TSObjectKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isTSStringKeyword(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSStringKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isTSSymbolKeyword(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSSymbolKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2992,11 +3284,11 @@ function isTSUndefinedKeyword(node, opts) { return false; } -function isTSNullKeyword(node, opts) { +function isTSUnknownKeyword(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSNullKeyword") { + if (nodeType === "TSUnknownKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -3007,11 +3299,11 @@ function isTSNullKeyword(node, opts) { return false; } -function isTSNeverKeyword(node, opts) { +function isTSVoidKeyword(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSNeverKeyword") { + if (nodeType === "TSVoidKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -3187,6 +3479,21 @@ function isTSRestType(node, opts) { return false; } +function isTSNamedTupleMember(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSNamedTupleMember") { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + function isTSUnionType(node, opts) { if (!node) return false; const nodeType = node.type; @@ -3626,7 +3933,7 @@ function isExpression(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Expression" || "ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "AwaitExpression" === nodeType || "BindExpression" === nodeType || "OptionalMemberExpression" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "OptionalCallExpression" === nodeType || "Import" === nodeType || "DoExpression" === nodeType || "BigIntLiteral" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Expression" === node.expectedNode || "Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode)) { + if (nodeType === "Expression" || "ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType || "Import" === nodeType || "BigIntLiteral" === nodeType || "OptionalMemberExpression" === nodeType || "OptionalCallExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "BindExpression" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "DoExpression" === nodeType || "RecordExpression" === nodeType || "TupleExpression" === nodeType || "DecimalLiteral" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Expression" === node.expectedNode || "Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode)) { if (typeof opts === "undefined") { return true; } else { @@ -3656,7 +3963,7 @@ function isScopable(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Scopable" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { + if (nodeType === "Scopable" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { if (typeof opts === "undefined") { return true; } else { @@ -3671,7 +3978,7 @@ function isBlockParent(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "BlockParent" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { + if (nodeType === "BlockParent" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { if (typeof opts === "undefined") { return true; } else { @@ -3701,7 +4008,7 @@ function isStatement(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Statement" || "BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || nodeType === "Placeholder" && ("Statement" === node.expectedNode || "Declaration" === node.expectedNode || "BlockStatement" === node.expectedNode)) { + if (nodeType === "Statement" || "BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || nodeType === "Placeholder" && ("Statement" === node.expectedNode || "Declaration" === node.expectedNode || "BlockStatement" === node.expectedNode)) { if (typeof opts === "undefined") { return true; } else { @@ -3866,7 +4173,7 @@ function isPureish(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Pureish" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType || "BigIntLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { + if (nodeType === "Pureish" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { if (typeof opts === "undefined") { return true; } else { @@ -3881,7 +4188,7 @@ function isDeclaration(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Declaration" || "FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || nodeType === "Placeholder" && "Declaration" === node.expectedNode) { + if (nodeType === "Declaration" || "FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || nodeType === "Placeholder" && "Declaration" === node.expectedNode) { if (typeof opts === "undefined") { return true; } else { @@ -3941,7 +4248,7 @@ function isLiteral(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Literal" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { + if (nodeType === "Literal" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { if (typeof opts === "undefined") { return true; } else { @@ -3956,7 +4263,7 @@ function isImmutable(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Immutable" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "BigIntLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { + if (nodeType === "Immutable" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "BigIntLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { if (typeof opts === "undefined") { return true; } else { @@ -4061,7 +4368,7 @@ function isClass(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Class" || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType) { + if (nodeType === "Class" || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType) { if (typeof opts === "undefined") { return true; } else { @@ -4106,7 +4413,7 @@ function isModuleSpecifier(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "ModuleSpecifier" || "ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType) { + if (nodeType === "ModuleSpecifier" || "ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType) { if (typeof opts === "undefined") { return true; } else { @@ -4121,7 +4428,7 @@ function isFlow(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "Flow" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType) { + if (nodeType === "Flow" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType) { if (typeof opts === "undefined") { return true; } else { @@ -4136,7 +4443,7 @@ function isFlowType(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "FlowType" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) { + if (nodeType === "FlowType" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) { if (typeof opts === "undefined") { return true; } else { @@ -4151,7 +4458,7 @@ function isFlowBaseAnnotation(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "FlowBaseAnnotation" || "AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) { + if (nodeType === "FlowBaseAnnotation" || "AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) { if (typeof opts === "undefined") { return true; } else { @@ -4192,6 +4499,36 @@ function isFlowPredicate(node, opts) { return false; } +function isEnumBody(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EnumBody" || "EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isEnumMember(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "EnumMember" || "EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + function isJSX(node, opts) { if (!node) return false; const nodeType = node.type; @@ -4241,7 +4578,22 @@ function isTSType(node, opts) { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSType" || "TSAnyKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) { + if (nodeType === "TSType" || "TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) { + if (typeof opts === "undefined") { + return true; + } else { + return (0, _shallowEqual.default)(node, opts); + } + } + + return false; +} + +function isTSBaseType(node, opts) { + if (!node) return false; + const nodeType = node.type; + + if (nodeType === "TSBaseType" || "TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSLiteralType" === nodeType) { if (typeof opts === "undefined") { return true; } else { diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/is.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/is.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/is.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/is.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBinding.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isBinding.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBinding.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isBinding.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBlockScoped.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isBlockScoped.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isBlockScoped.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isBlockScoped.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isImmutable.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isImmutable.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isImmutable.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isImmutable.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isLet.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isLet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isLet.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isLet.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNode.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isNode.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNode.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isNode.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNodesEquivalent.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isNodesEquivalent.js similarity index 92% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNodesEquivalent.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isNodesEquivalent.js index 0c3b8ac437921c..b418c6a2d1d1c3 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isNodesEquivalent.js @@ -48,7 +48,7 @@ function isNodesEquivalent(a, b) { continue; } - if (typeof a[field] === "object" && (!visitorKeys || !visitorKeys.includes(field))) { + if (typeof a[field] === "object" && !(visitorKeys == null ? void 0 : visitorKeys.includes(field))) { for (const key of Object.keys(a[field])) { if (a[field][key] !== b[field][key]) { return false; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isPlaceholderType.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isPlaceholderType.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isPlaceholderType.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isPlaceholderType.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isReferenced.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isReferenced.js similarity index 96% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isReferenced.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isReferenced.js index 46598dd1c8746b..8fd1662348ce13 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isReferenced.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isReferenced.js @@ -32,12 +32,16 @@ function isReferenced(node, parent, grandparent) { case "PrivateName": return false; - case "ObjectProperty": - case "ClassProperty": - case "ClassPrivateProperty": case "ClassMethod": case "ClassPrivateMethod": case "ObjectMethod": + if (parent.params.includes(node)) { + return false; + } + + case "ObjectProperty": + case "ClassProperty": + case "ClassPrivateProperty": if (parent.key === node) { return !!parent.computed; } diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isScope.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isScope.js new file mode 100644 index 00000000000000..0f82449cce7a8c --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isScope.js @@ -0,0 +1,20 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isScope; + +var _generated = require("./generated"); + +function isScope(node, parent) { + if ((0, _generated.isBlockStatement)(node) && ((0, _generated.isFunction)(parent) || (0, _generated.isCatchClause)(parent))) { + return false; + } + + if ((0, _generated.isPattern)(node) && ((0, _generated.isFunction)(parent) || (0, _generated.isCatchClause)(parent))) { + return true; + } + + return (0, _generated.isScopable)(node); +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isSpecifierDefault.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isSpecifierDefault.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isSpecifierDefault.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isSpecifierDefault.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isType.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isType.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isType.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isType.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidES3Identifier.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isValidES3Identifier.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidES3Identifier.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isValidES3Identifier.js diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isValidIdentifier.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isValidIdentifier.js new file mode 100644 index 00000000000000..c1adb9afe0d25e --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isValidIdentifier.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isValidIdentifier; + +var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); + +function isValidIdentifier(name, reserved = true) { + if (typeof name !== "string") return false; + + if (reserved) { + if ((0, _helperValidatorIdentifier.isKeyword)(name) || (0, _helperValidatorIdentifier.isStrictReservedWord)(name)) { + return false; + } else if (name === "await") { + return false; + } + } + + return (0, _helperValidatorIdentifier.isIdentifierName)(name); +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isVar.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isVar.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isVar.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/isVar.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/matchesPattern.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/matchesPattern.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/matchesPattern.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/matchesPattern.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isCompatTag.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/react/isCompatTag.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isCompatTag.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/react/isCompatTag.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isReactComponent.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/react/isReactComponent.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/react/isReactComponent.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/react/isReactComponent.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/validate.js b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/validate.js similarity index 62% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/validate.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/validate.js index 092da9913d9e71..0d152a22cf49b9 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/validate.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/lib/validators/validate.js @@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = validate; exports.validateField = validateField; +exports.validateChild = validateChild; var _definitions = require("../definitions"); @@ -14,10 +15,18 @@ function validate(node, key, val) { if (!fields) return; const field = fields[key]; validateField(node, key, val, field); + validateChild(node, key, val); } function validateField(node, key, val, field) { - if (!field || !field.validate) return; + if (!(field == null ? void 0 : field.validate)) return; if (field.optional && val == null) return; field.validate(node, key, val); +} + +function validateChild(node, key, val) { + if (val == null) return; + const validate = _definitions.NODE_PARENT_VALIDATIONS[val.type]; + if (!validate) return; + validate(node, key, val); } \ No newline at end of file diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/package.json b/tools/node_modules/@babel/core/node_modules/@babel/types/package.json new file mode 100644 index 00000000000000..7a3a503ea30e5b --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/package.json @@ -0,0 +1,35 @@ +{ + "name": "@babel/types", + "version": "7.12.7", + "description": "Babel Types is a Lodash-esque utility library for AST nodes", + "author": "Sebastian McKenzie ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-types" + }, + "main": "lib/index.js", + "types": "lib/index.d.ts", + "typesVersions": { + ">=3.7": { + "lib/index.d.ts": [ + "lib/index-ts3.7.d.ts" + ] + } + }, + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + }, + "devDependencies": { + "@babel/generator": "7.12.5", + "@babel/parser": "7.12.7", + "chalk": "^4.1.0" + } +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generateTypeHelpers.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generateTypeHelpers.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generateTypeHelpers.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generateTypeHelpers.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/docs.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/docs.js similarity index 89% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/docs.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/docs.js index 3bbb52362400bb..169894895b3c0b 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/docs.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/docs.js @@ -39,7 +39,7 @@ const customTypes = { }; Object.keys(types.BUILDER_KEYS) .sort() - .forEach(function(key) { + .forEach(function (key) { readme.push("### " + key[0].toLowerCase() + key.substr(1)); readme.push("```javascript"); readme.push( @@ -63,7 +63,7 @@ Object.keys(types.BUILDER_KEYS) readme.push( "Aliases: " + types.ALIAS_KEYS[key] - .map(function(key) { + .map(function (key) { return "`" + key + "`"; }) .join(", ") @@ -71,7 +71,7 @@ Object.keys(types.BUILDER_KEYS) readme.push(""); } Object.keys(types.NODE_FIELDS[key]) - .sort(function(fieldA, fieldB) { + .sort(function (fieldA, fieldB) { const indexA = types.BUILDER_KEYS[key].indexOf(fieldA); const indexB = types.BUILDER_KEYS[key].indexOf(fieldB); if (indexA === indexB) return fieldA < fieldB ? -1 : 1; @@ -79,7 +79,7 @@ Object.keys(types.BUILDER_KEYS) if (indexB === -1) return -1; return indexA - indexB; }) - .forEach(function(field) { + .forEach(function (field) { const defaultValue = types.NODE_FIELDS[key][field].default; const fieldDescription = ["`" + field + "`"]; const validator = types.NODE_FIELDS[key][field].validate; @@ -101,8 +101,12 @@ Object.keys(types.BUILDER_KEYS) } if (defaultValue !== null || types.NODE_FIELDS[key][field].optional) { fieldDescription.push( - " (default: `" + util.inspect(defaultValue) + "`)" + " (default: `" + util.inspect(defaultValue) + "`" ); + if (types.BUILDER_KEYS[key].indexOf(field) < 0) { + fieldDescription.push(", excluded from builder function"); + } + fieldDescription.push(")"); } else { fieldDescription.push(" (required)"); } diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/flow.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/flow.js new file mode 100644 index 00000000000000..2a91703353db3a --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/flow.js @@ -0,0 +1,257 @@ +"use strict"; + +const t = require("../../"); +const stringifyValidator = require("../utils/stringifyValidator"); +const toFunctionName = require("../utils/toFunctionName"); + +const NODE_PREFIX = "BabelNode"; + +let code = `// NOTE: This file is autogenerated. Do not modify. +// See packages/babel-types/scripts/generators/flow.js for script used. + +declare class ${NODE_PREFIX}Comment { + value: string; + start: number; + end: number; + loc: ${NODE_PREFIX}SourceLocation; +} + +declare class ${NODE_PREFIX}CommentBlock extends ${NODE_PREFIX}Comment { + type: "CommentBlock"; +} + +declare class ${NODE_PREFIX}CommentLine extends ${NODE_PREFIX}Comment { + type: "CommentLine"; +} + +declare class ${NODE_PREFIX}SourceLocation { + start: { + line: number; + column: number; + }; + + end: { + line: number; + column: number; + }; +} + +declare class ${NODE_PREFIX} { + leadingComments?: Array<${NODE_PREFIX}Comment>; + innerComments?: Array<${NODE_PREFIX}Comment>; + trailingComments?: Array<${NODE_PREFIX}Comment>; + start: ?number; + end: ?number; + loc: ?${NODE_PREFIX}SourceLocation; + extra?: { [string]: mixed }; +}\n\n`; + +// + +const lines = []; + +for (const type in t.NODE_FIELDS) { + const fields = t.NODE_FIELDS[type]; + + const struct = ['type: "' + type + '";']; + const args = []; + const builderNames = t.BUILDER_KEYS[type]; + + Object.keys(t.NODE_FIELDS[type]) + .sort((fieldA, fieldB) => { + const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); + const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); + if (indexA === indexB) return fieldA < fieldB ? -1 : 1; + if (indexA === -1) return 1; + if (indexB === -1) return -1; + return indexA - indexB; + }) + .forEach(fieldName => { + const field = fields[fieldName]; + + let suffix = ""; + if (field.optional || field.default != null) suffix += "?"; + + let typeAnnotation = "any"; + + const validate = field.validate; + if (validate) { + typeAnnotation = stringifyValidator(validate, NODE_PREFIX); + } + + if (typeAnnotation) { + suffix += ": " + typeAnnotation; + } + if (builderNames.includes(fieldName)) { + args.push(t.toBindingIdentifierName(fieldName) + suffix); + } + + if (t.isValidIdentifier(fieldName)) { + struct.push(fieldName + suffix + ";"); + } + }); + + code += `declare class ${NODE_PREFIX}${type} extends ${NODE_PREFIX} { + ${struct.join("\n ").trim()} +}\n\n`; + + // Flow chokes on super() and import() :/ + if (type !== "Super" && type !== "Import") { + lines.push( + `declare function ${toFunctionName(type)}(${args.join( + ", " + )}): ${NODE_PREFIX}${type};` + ); + } else { + const functionName = toFunctionName(type); + lines.push( + `declare function _${functionName}(${args.join( + ", " + )}): ${NODE_PREFIX}${type};`, + `declare export { _${functionName} as ${functionName} }` + ); + } +} + +for (const typeName of t.TYPES) { + const isDeprecated = !!t.DEPRECATED_KEYS[typeName]; + const realName = isDeprecated ? t.DEPRECATED_KEYS[typeName] : typeName; + + let decl = `declare function is${typeName}(node: ?Object, opts?: ?Object): boolean`; + if (t.NODE_FIELDS[realName]) { + decl += ` %checks (node instanceof ${NODE_PREFIX}${realName})`; + } + lines.push(decl); + + lines.push( + `declare function assert${typeName}(node: ?Object, opts?: ?Object): void` + ); +} + +lines.push( + // assert/ + `declare function assertNode(obj: any): void`, + + // builders/ + // eslint-disable-next-line max-len + `declare function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): ${NODE_PREFIX}TypeAnnotation`, + // eslint-disable-next-line max-len + `declare function createUnionTypeAnnotation(types: Array<${NODE_PREFIX}FlowType>): ${NODE_PREFIX}UnionTypeAnnotation`, + // eslint-disable-next-line max-len + `declare function createFlowUnionType(types: Array<${NODE_PREFIX}FlowType>): ${NODE_PREFIX}UnionTypeAnnotation`, + // this smells like "internal API" + // eslint-disable-next-line max-len + `declare function buildChildren(node: { children: Array<${NODE_PREFIX}JSXText | ${NODE_PREFIX}JSXExpressionContainer | ${NODE_PREFIX}JSXSpreadChild | ${NODE_PREFIX}JSXElement | ${NODE_PREFIX}JSXFragment | ${NODE_PREFIX}JSXEmptyExpression> }): Array<${NODE_PREFIX}JSXText | ${NODE_PREFIX}JSXExpressionContainer | ${NODE_PREFIX}JSXSpreadChild | ${NODE_PREFIX}JSXElement | ${NODE_PREFIX}JSXFragment>`, + + // clone/ + `declare function clone(n: T): T;`, + `declare function cloneDeep(n: T): T;`, + `declare function cloneDeepWithoutLoc(n: T): T;`, + `declare function cloneNode(n: T, deep?: boolean, withoutLoc?: boolean): T;`, + `declare function cloneWithoutLoc(n: T): T;`, + + // comments/ + `declare type CommentTypeShorthand = 'leading' | 'inner' | 'trailing'`, + // eslint-disable-next-line max-len + `declare function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T`, + // eslint-disable-next-line max-len + `declare function addComments(node: T, type: CommentTypeShorthand, comments: Array): T`, + `declare function inheritInnerComments(node: Node, parent: Node): void`, + `declare function inheritLeadingComments(node: Node, parent: Node): void`, + `declare function inheritsComments(node: T, parent: Node): void`, + `declare function inheritTrailingComments(node: Node, parent: Node): void`, + `declare function removeComments(node: T): T`, + + // converters/ + `declare function ensureBlock(node: ${NODE_PREFIX}, key: string): ${NODE_PREFIX}BlockStatement`, + `declare function toBindingIdentifierName(name?: ?string): string`, + // eslint-disable-next-line max-len + `declare function toBlock(node: ${NODE_PREFIX}Statement | ${NODE_PREFIX}Expression, parent?: ${NODE_PREFIX}Function | null): ${NODE_PREFIX}BlockStatement`, + // eslint-disable-next-line max-len + `declare function toComputedKey(node: ${NODE_PREFIX}Method | ${NODE_PREFIX}Property, key?: ${NODE_PREFIX}Expression | ${NODE_PREFIX}Identifier): ${NODE_PREFIX}Expression`, + // eslint-disable-next-line max-len + `declare function toExpression(node: ${NODE_PREFIX}ExpressionStatement | ${NODE_PREFIX}Expression | ${NODE_PREFIX}Class | ${NODE_PREFIX}Function): ${NODE_PREFIX}Expression`, + `declare function toIdentifier(name?: ?string): string`, + // eslint-disable-next-line max-len + `declare function toKeyAlias(node: ${NODE_PREFIX}Method | ${NODE_PREFIX}Property, key?: ${NODE_PREFIX}): string`, + // toSequenceExpression relies on types that aren't declared in flow + // eslint-disable-next-line max-len + `declare function toStatement(node: ${NODE_PREFIX}Statement | ${NODE_PREFIX}Class | ${NODE_PREFIX}Function | ${NODE_PREFIX}AssignmentExpression, ignore?: boolean): ${NODE_PREFIX}Statement | void`, + `declare function valueToNode(value: any): ${NODE_PREFIX}Expression`, + + // modifications/ + // eslint-disable-next-line max-len + `declare function removeTypeDuplicates(types: Array<${NODE_PREFIX}FlowType>): Array<${NODE_PREFIX}FlowType>`, + // eslint-disable-next-line max-len + `declare function appendToMemberExpression(member: ${NODE_PREFIX}MemberExpression, append: ${NODE_PREFIX}, computed?: boolean): ${NODE_PREFIX}MemberExpression`, + // eslint-disable-next-line max-len + `declare function inherits(child: T, parent: ${NODE_PREFIX} | null | void): T`, + // eslint-disable-next-line max-len + `declare function prependToMemberExpression(member: ${NODE_PREFIX}MemberExpression, prepend: ${NODE_PREFIX}Expression): ${NODE_PREFIX}MemberExpression`, + `declare function removeProperties(n: T, opts: ?{}): void;`, + `declare function removePropertiesDeep(n: T, opts: ?{}): T;`, + + // retrievers/ + // eslint-disable-next-line max-len + `declare function getBindingIdentifiers(node: ${NODE_PREFIX}, duplicates: boolean, outerOnly?: boolean): { [key: string]: ${NODE_PREFIX}Identifier | Array<${NODE_PREFIX}Identifier> }`, + // eslint-disable-next-line max-len + `declare function getOuterBindingIdentifiers(node: Node, duplicates: boolean): { [key: string]: ${NODE_PREFIX}Identifier | Array<${NODE_PREFIX}Identifier> }`, + + // traverse/ + `declare type TraversalAncestors = Array<{ + node: BabelNode, + key: string, + index?: number, + }>; + declare type TraversalHandler = (BabelNode, TraversalAncestors, T) => void; + declare type TraversalHandlers = { + enter?: TraversalHandler, + exit?: TraversalHandler, + };`.replace(/(^|\n) {2}/g, "$1"), + // eslint-disable-next-line + `declare function traverse(n: BabelNode, TraversalHandler | TraversalHandlers, state?: T): void;`, + `declare function traverseFast(n: Node, h: TraversalHandler, state?: T): void;`, + + // utils/ + // cleanJSXElementLiteralChild is not exported + // inherit is not exported + `declare function shallowEqual(actual: Object, expected: Object): boolean`, + + // validators/ + // eslint-disable-next-line max-len + `declare function buildMatchMemberExpression(match: string, allowPartial?: boolean): (?BabelNode) => boolean`, + `declare function is(type: string, n: BabelNode, opts: Object): boolean;`, + `declare function isBinding(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`, + `declare function isBlockScoped(node: BabelNode): boolean`, + `declare function isImmutable(node: BabelNode): boolean`, + `declare function isLet(node: BabelNode): boolean`, + `declare function isNode(node: ?Object): boolean`, + `declare function isNodesEquivalent(a: any, b: any): boolean`, + `declare function isPlaceholderType(placeholderType: string, targetType: string): boolean`, + `declare function isReferenced(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`, + `declare function isScope(node: BabelNode, parent: BabelNode): boolean`, + `declare function isSpecifierDefault(specifier: BabelNodeModuleSpecifier): boolean`, + `declare function isType(nodetype: ?string, targetType: string): boolean`, + `declare function isValidES3Identifier(name: string): boolean`, + `declare function isValidES3Identifier(name: string): boolean`, + `declare function isValidIdentifier(name: string): boolean`, + `declare function isVar(node: BabelNode): boolean`, + // eslint-disable-next-line max-len + `declare function matchesPattern(node: ?BabelNode, match: string | Array, allowPartial?: boolean): boolean`, + `declare function validate(n: BabelNode, key: string, value: mixed): void;` +); + +for (const type in t.FLIPPED_ALIAS_KEYS) { + const types = t.FLIPPED_ALIAS_KEYS[type]; + code += `type ${NODE_PREFIX}${type} = ${types + .map(type => `${NODE_PREFIX}${type}`) + .join(" | ")};\n`; +} + +code += `\ndeclare module "@babel/types" { + ${lines.join("\n").replace(/\n/g, "\n ").trim()} +}\n`; + +// + +process.stdout.write(code); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateAsserts.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/generateAsserts.js similarity index 89% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateAsserts.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/generateAsserts.js index 150e8557c733e4..26bdb8dccbed58 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateAsserts.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/generateAsserts.js @@ -18,7 +18,8 @@ import is from "../../validators/is"; function assert(type: string, node: Object, opts?: Object): void { if (!is(type, node, opts)) { throw new Error( - \`Expected type "\${type}" with option \${JSON.stringify(opts)}, but instead got "\${node.type}".\`, + \`Expected type "\${type}" with option \${JSON.stringify((opts: any))}, \` + + \`but instead got "\${node.type}".\`, ); } }\n\n`; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateBuilders.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/generateBuilders.js similarity index 57% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateBuilders.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/generateBuilders.js index 08a5b6fc61555f..5ca9f74643aabb 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateBuilders.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/generateBuilders.js @@ -11,15 +11,29 @@ module.exports = function generateBuilders() { */ import builder from "../builder";\n\n`; + const reservedNames = new Set(["super", "import"]); Object.keys(definitions.BUILDER_KEYS).forEach(type => { - output += `export function ${type}(...args: Array): Object { return builder("${type}", ...args); } -export { ${type} as ${formatBuilderName(type)} };\n`; + const formatedBuilderName = formatBuilderName(type); + const formatedBuilderNameLocal = reservedNames.has(formatedBuilderName) + ? `_${formatedBuilderName}` + : formatedBuilderName; + output += `${ + formatedBuilderNameLocal === formatedBuilderName ? "export " : "" + }function ${formatedBuilderNameLocal}(...args: Array): Object { return builder("${type}", ...args); }\n`; + // This is needed for backwards compatibility. + // arrayExpression -> ArrayExpression + output += `export { ${formatedBuilderNameLocal} as ${type} };\n`; + if (formatedBuilderNameLocal !== formatedBuilderName) { + output += `export { ${formatedBuilderNameLocal} as ${formatedBuilderName} };\n`; + } // This is needed for backwards compatibility. // It should be removed in the next major version. // JSXIdentifier -> jSXIdentifier if (/^[A-Z]{2}/.test(type)) { - output += `export { ${type} as ${lowerFirst(type)} }\n`; + output += `export { ${formatedBuilderNameLocal} as ${lowerFirst( + type + )} }\n`; } }); @@ -27,7 +41,7 @@ export { ${type} as ${formatBuilderName(type)} };\n`; const newType = definitions.DEPRECATED_KEYS[type]; output += `export function ${type}(...args: Array): Object { console.trace("The node type ${type} has been renamed to ${newType}"); - return ${type}("${type}", ...args); + return builder("${type}", ...args); } export { ${type} as ${formatBuilderName(type)} };\n`; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateConstants.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/generateConstants.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateConstants.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/generateConstants.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateValidators.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/generateValidators.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/generateValidators.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/generateValidators.js diff --git a/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/typescript.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/typescript.js new file mode 100644 index 00000000000000..210124d829dff4 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/typescript.js @@ -0,0 +1,381 @@ +"use strict"; + +const t = require("../../"); +const stringifyValidator = require("../utils/stringifyValidator"); +const toFunctionName = require("../utils/toFunctionName"); + +// For backward compat, we cannot use TS 3.7 syntax in published packages +const ts3_7 = process.argv.includes("--ts3.7"); + +// TypeScript 3.7: https://github.com/microsoft/TypeScript/pull/32695 will allow assert declarations +const asserts = ts3_7 ? assertion => `asserts ${assertion}` : () => `void`; + +let code = `// NOTE: This file is autogenerated. Do not modify. +// See packages/babel-types/scripts/generators/typescript.js for script used. + +interface BaseComment { + value: string; + start: number; + end: number; + loc: SourceLocation; + type: "CommentBlock" | "CommentLine"; +} + +export interface CommentBlock extends BaseComment { + type: "CommentBlock"; +} + +export interface CommentLine extends BaseComment { + type: "CommentLine"; +} + +export type Comment = CommentBlock | CommentLine; + +export interface SourceLocation { + start: { + line: number; + column: number; + }; + + end: { + line: number; + column: number; + }; +} + +interface BaseNode { + leadingComments: ReadonlyArray | null; + innerComments: ReadonlyArray | null; + trailingComments: ReadonlyArray | null; + start: number | null; + end: number | null; + loc: SourceLocation | null; + type: Node["type"]; + extra?: Record; +} + +export type Node = ${t.TYPES.sort().join(" | ")};\n\n`; + +// + +const lines = []; + +for (const type in t.NODE_FIELDS) { + const fields = t.NODE_FIELDS[type]; + const fieldNames = sortFieldNames(Object.keys(t.NODE_FIELDS[type]), type); + const builderNames = t.BUILDER_KEYS[type]; + + const struct = ['type: "' + type + '";']; + const args = []; + + fieldNames.forEach(fieldName => { + const field = fields[fieldName]; + // Future / annoying TODO: + // MemberExpression.property, ObjectProperty.key and ObjectMethod.key need special cases; either: + // - convert the declaration to chain() like ClassProperty.key and ClassMethod.key, + // - declare an alias type for valid keys, detect the case and reuse it here, + // - declare a disjoint union with, for example, ObjectPropertyBase, + // ObjectPropertyLiteralKey and ObjectPropertyComputedKey, and declare ObjectProperty + // as "ObjectPropertyBase & (ObjectPropertyLiteralKey | ObjectPropertyComputedKey)" + let typeAnnotation = stringifyValidator(field.validate, ""); + + if (isNullable(field) && !hasDefault(field)) { + typeAnnotation += " | null"; + } + + if (builderNames.includes(fieldName)) { + if (areAllRemainingFieldsNullable(fieldName, builderNames, fields)) { + args.push( + `${t.toBindingIdentifierName(fieldName)}${ + isNullable(field) ? "?:" : ":" + } ${typeAnnotation}` + ); + } else { + args.push( + `${t.toBindingIdentifierName(fieldName)}: ${typeAnnotation}${ + isNullable(field) ? " | undefined" : "" + }` + ); + } + } + + const alphaNumeric = /^\w+$/; + + if (t.isValidIdentifier(fieldName) || alphaNumeric.test(fieldName)) { + struct.push(`${fieldName}: ${typeAnnotation};`); + } else { + struct.push(`"${fieldName}": ${typeAnnotation};`); + } + }); + + code += `export interface ${type} extends BaseNode { + ${struct.join("\n ").trim()} +}\n\n`; + + // super and import are reserved words in JavaScript + if (type !== "Super" && type !== "Import") { + lines.push( + `export function ${toFunctionName(type)}(${args.join(", ")}): ${type};` + ); + } else { + const functionName = toFunctionName(type); + lines.push( + `declare function _${functionName}(${args.join(", ")}): ${type};`, + `export { _${functionName} as ${functionName}}` + ); + } +} + +for (const typeName of t.TYPES) { + const isDeprecated = !!t.DEPRECATED_KEYS[typeName]; + const realName = isDeprecated ? t.DEPRECATED_KEYS[typeName] : typeName; + + const result = + t.NODE_FIELDS[realName] || t.FLIPPED_ALIAS_KEYS[realName] + ? `node is ${realName}` + : "boolean"; + + if (isDeprecated) { + lines.push(`/** @deprecated Use \`is${realName}\` */`); + } + lines.push( + `export function is${typeName}(node: object | null | undefined, opts?: object | null): ${result};` + ); + + if (isDeprecated) { + lines.push(`/** @deprecated Use \`assert${realName}\` */`); + } + lines.push( + `export function assert${typeName}(node: object | null | undefined, opts?: object | null): ${asserts( + result === "boolean" ? "node" : result + )};` + ); +} + +lines.push( + // assert/ + `export function assertNode(obj: any): ${asserts("obj is Node")}`, + + // builders/ + // eslint-disable-next-line max-len + `export function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): StringTypeAnnotation | VoidTypeAnnotation | NumberTypeAnnotation | BooleanTypeAnnotation | GenericTypeAnnotation`, + `export function createUnionTypeAnnotation(types: [T]): T`, + `export function createFlowUnionType(types: [T]): T`, + // this probably misbehaves if there are 0 elements, and it's not a UnionTypeAnnotation if there's only 1 + // it is possible to require "2 or more" for this overload ([T, T, ...T[]]) but it requires typescript 3.0 + `export function createUnionTypeAnnotation(types: ReadonlyArray): UnionTypeAnnotation`, + `export function createFlowUnionType(types: ReadonlyArray): UnionTypeAnnotation`, + // this smells like "internal API" + // eslint-disable-next-line max-len + `export function buildChildren(node: { children: ReadonlyArray }): JSXElement['children']`, + + // clone/ + `export function clone(n: T): T;`, + `export function cloneDeep(n: T): T;`, + `export function cloneDeepWithoutLoc(n: T): T;`, + `export function cloneNode(n: T, deep?: boolean, withoutLoc?: boolean): T;`, + `export function cloneWithoutLoc(n: T): T;`, + + // comments/ + `export type CommentTypeShorthand = 'leading' | 'inner' | 'trailing'`, + // eslint-disable-next-line max-len + `export function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T`, + // eslint-disable-next-line max-len + `export function addComments(node: T, type: CommentTypeShorthand, comments: ReadonlyArray): T`, + `export function inheritInnerComments(node: Node, parent: Node): void`, + `export function inheritLeadingComments(node: Node, parent: Node): void`, + `export function inheritsComments(node: T, parent: Node): void`, + `export function inheritTrailingComments(node: Node, parent: Node): void`, + `export function removeComments(node: T): T`, + + // converters/ + // eslint-disable-next-line max-len + `export function ensureBlock(node: Extract): BlockStatement`, + // too complex? + // eslint-disable-next-line max-len + `export function ensureBlock = 'body'>(node: Extract>, key: K): BlockStatement`, + // gatherSequenceExpressions is not exported + `export function toBindingIdentifierName(name: { toString(): string } | null | undefined): string`, + `export function toBlock(node: Statement | Expression, parent?: Function | null): BlockStatement`, + // it is possible for `node` to be an arbitrary object if `key` is always provided, + // but that doesn't look like intended API + // eslint-disable-next-line max-len + `export function toComputedKey>(node: T, key?: Expression | Identifier): Expression`, + `export function toExpression(node: Function): FunctionExpression`, + `export function toExpression(node: Class): ClassExpression`, + `export function toExpression(node: ExpressionStatement | Expression | Class | Function): Expression`, + `export function toIdentifier(name: { toString(): string } | null | undefined): string`, + `export function toKeyAlias(node: Method | Property, key?: Node): string`, + // NOTE: this actually uses Scope from @babel/traverse, but we can't add a dependency on its types, + // as they live in @types. Declare the structural subset that is required. + // eslint-disable-next-line max-len + `export function toSequenceExpression(nodes: ReadonlyArray, scope: { push(value: { id: LVal; kind: 'var'; init?: Expression}): void; buildUndefinedNode(): Node }): SequenceExpression | undefined`, + `export function toStatement(node: AssignmentExpression, ignore?: boolean): ExpressionStatement`, + `export function toStatement(node: Statement | AssignmentExpression, ignore?: boolean): Statement`, + `export function toStatement(node: Class, ignore: true): ClassDeclaration | undefined`, + `export function toStatement(node: Class, ignore?: boolean): ClassDeclaration`, + `export function toStatement(node: Function, ignore: true): FunctionDeclaration | undefined`, + `export function toStatement(node: Function, ignore?: boolean): FunctionDeclaration`, + // eslint-disable-next-line max-len + `export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore: true): Statement | undefined`, + // eslint-disable-next-line max-len + `export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore?: boolean): Statement`, + // eslint-disable-next-line max-len + `export function valueToNode(value: undefined): Identifier`, // (should this not be a UnaryExpression to avoid shadowing?) + `export function valueToNode(value: boolean): BooleanLiteral`, + `export function valueToNode(value: null): NullLiteral`, + `export function valueToNode(value: string): StringLiteral`, + // Infinities and NaN need to use a BinaryExpression; negative values must be wrapped in UnaryExpression + `export function valueToNode(value: number): NumericLiteral | BinaryExpression | UnaryExpression`, + `export function valueToNode(value: RegExp): RegExpLiteral`, + // eslint-disable-next-line max-len + `export function valueToNode(value: ReadonlyArray): ArrayExpression`, + // this throws with objects that are not PlainObject according to lodash, + // or if there are non-valueToNode-able values + `export function valueToNode(value: object): ObjectExpression`, + // eslint-disable-next-line max-len + `export function valueToNode(value: undefined | boolean | null | string | number | RegExp | object): Expression`, + + // modifications/ + // eslint-disable-next-line max-len + `export function removeTypeDuplicates(types: ReadonlyArray): FlowType[]`, + // eslint-disable-next-line max-len + `export function appendToMemberExpression>(member: T, append: MemberExpression['property'], computed?: boolean): T`, + // eslint-disable-next-line max-len + `export function inherits(child: T, parent: Node | null | undefined): T`, + // eslint-disable-next-line max-len + `export function prependToMemberExpression>(member: T, prepend: MemberExpression['object']): T`, + `export function removeProperties( + n: Node, + opts?: { preserveComments: boolean } | null +): void;`, + `export function removePropertiesDeep( + n: T, + opts?: { preserveComments: boolean } | null +): T;`, + + // retrievers/ + // eslint-disable-next-line max-len + `export function getBindingIdentifiers(node: Node, duplicates: true, outerOnly?: boolean): Record>`, + // eslint-disable-next-line max-len + `export function getBindingIdentifiers(node: Node, duplicates?: false, outerOnly?: boolean): Record`, + // eslint-disable-next-line max-len + `export function getBindingIdentifiers(node: Node, duplicates: boolean, outerOnly?: boolean): Record>`, + // eslint-disable-next-line max-len + `export function getOuterBindingIdentifiers(node: Node, duplicates: true): Record>`, + `export function getOuterBindingIdentifiers(node: Node, duplicates?: false): Record`, + // eslint-disable-next-line max-len + `export function getOuterBindingIdentifiers(node: Node, duplicates: boolean): Record>`, + + // traverse/ + `export type TraversalAncestors = ReadonlyArray<{ + node: Node, + key: string, + index?: number, + }>; + export type TraversalHandler = ( + this: undefined, node: Node, parent: TraversalAncestors, type: T + ) => void; + export type TraversalHandlers = { + enter?: TraversalHandler, + exit?: TraversalHandler, + };`.replace(/(^|\n) {2}/g, "$1"), + // eslint-disable-next-line + `export function traverse(n: Node, h: TraversalHandler | TraversalHandlers, state?: T): void;`, + `export function traverseFast(n: Node, h: TraversalHandler, state?: T): void;`, + + // utils/ + // cleanJSXElementLiteralChild is not exported + // inherit is not exported + `export function shallowEqual(actual: object, expected: T): actual is T`, + + // validators/ + // eslint-disable-next-line max-len + `export function buildMatchMemberExpression(match: string, allowPartial?: boolean): (node: Node | null | undefined) => node is MemberExpression`, + // eslint-disable-next-line max-len + `export function is(type: T, n: Node | null | undefined, required?: undefined): n is Extract`, + // eslint-disable-next-line max-len + `export function is>(type: T, n: Node | null | undefined, required: Partial

): n is P`, + // eslint-disable-next-line max-len + `export function is

(type: string, n: Node | null | undefined, required: Partial

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

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

+ * The main interface is the {@link analyze} function. + * @module escope + */ +"use strict"; + +/* eslint no-underscore-dangle: ["error", { "allow": ["__currentScope"] }] */ + +const assert = require("assert"); + +const ScopeManager = require("./scope-manager"); +const Referencer = require("./referencer"); +const Reference = require("./reference"); +const Variable = require("./variable"); +const Scope = require("./scope").Scope; +const version = require("../package.json").version; + +/** + * Set the default options + * @returns {Object} options + */ +function defaultOptions() { + return { + optimistic: false, + directive: false, + nodejsScope: false, + impliedStrict: false, + sourceType: "script", // one of ['script', 'module'] + ecmaVersion: 5, + childVisitorKeys: null, + fallback: "iteration" + }; +} + +/** + * Preform deep update on option object + * @param {Object} target - Options + * @param {Object} override - Updates + * @returns {Object} Updated options + */ +function updateDeeply(target, override) { + + /** + * Is hash object + * @param {Object} value - Test value + * @returns {boolean} Result + */ + function isHashObject(value) { + return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp); + } + + for (const key in override) { + if (Object.prototype.hasOwnProperty.call(override, key)) { + const val = override[key]; + + if (isHashObject(val)) { + if (isHashObject(target[key])) { + updateDeeply(target[key], val); + } else { + target[key] = updateDeeply({}, val); + } + } else { + target[key] = val; + } + } + } + return target; +} + +/** + * Main interface function. Takes an Espree syntax tree and returns the + * analyzed scopes. + * @function analyze + * @param {espree.Tree} tree - Abstract Syntax Tree + * @param {Object} providedOptions - Options that tailor the scope analysis + * @param {boolean} [providedOptions.optimistic=false] - the optimistic flag + * @param {boolean} [providedOptions.directive=false]- the directive flag + * @param {boolean} [providedOptions.ignoreEval=false]- whether to check 'eval()' calls + * @param {boolean} [providedOptions.nodejsScope=false]- whether the whole + * script is executed under node.js environment. When enabled, escope adds + * a function scope immediately following the global scope. + * @param {boolean} [providedOptions.impliedStrict=false]- implied strict mode + * (if ecmaVersion >= 5). + * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module' + * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered + * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. + * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. + * @returns {ScopeManager} ScopeManager + */ +function analyze(tree, providedOptions) { + const options = updateDeeply(defaultOptions(), providedOptions); + const scopeManager = new ScopeManager(options); + const referencer = new Referencer(options, scopeManager); + + referencer.visit(tree); + + assert(scopeManager.__currentScope === null, "currentScope should be null."); + + return scopeManager; +} + +module.exports = { + + /** @name module:escope.version */ + version, + + /** @name module:escope.Reference */ + Reference, + + /** @name module:escope.Variable */ + Variable, + + /** @name module:escope.Scope */ + Scope, + + /** @name module:escope.ScopeManager */ + ScopeManager, + analyze +}; + + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/pattern-visitor.js b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/pattern-visitor.js new file mode 100644 index 00000000000000..afa629173b73ae --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/pattern-visitor.js @@ -0,0 +1,152 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-undefined */ + +const Syntax = require("estraverse").Syntax; +const esrecurse = require("esrecurse"); + +/** + * Get last array element + * @param {array} xs - array + * @returns {any} Last elment + */ +function getLast(xs) { + return xs[xs.length - 1] || null; +} + +class PatternVisitor extends esrecurse.Visitor { + static isPattern(node) { + const nodeType = node.type; + + return ( + nodeType === Syntax.Identifier || + nodeType === Syntax.ObjectPattern || + nodeType === Syntax.ArrayPattern || + nodeType === Syntax.SpreadElement || + nodeType === Syntax.RestElement || + nodeType === Syntax.AssignmentPattern + ); + } + + constructor(options, rootPattern, callback) { + super(null, options); + this.rootPattern = rootPattern; + this.callback = callback; + this.assignments = []; + this.rightHandNodes = []; + this.restElements = []; + } + + Identifier(pattern) { + const lastRestElement = getLast(this.restElements); + + this.callback(pattern, { + topLevel: pattern === this.rootPattern, + rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern, + assignments: this.assignments + }); + } + + Property(property) { + + // Computed property's key is a right hand node. + if (property.computed) { + this.rightHandNodes.push(property.key); + } + + // If it's shorthand, its key is same as its value. + // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). + // If it's not shorthand, the name of new variable is its value's. + this.visit(property.value); + } + + ArrayPattern(pattern) { + for (let i = 0, iz = pattern.elements.length; i < iz; ++i) { + const element = pattern.elements[i]; + + this.visit(element); + } + } + + AssignmentPattern(pattern) { + this.assignments.push(pattern); + this.visit(pattern.left); + this.rightHandNodes.push(pattern.right); + this.assignments.pop(); + } + + RestElement(pattern) { + this.restElements.push(pattern); + this.visit(pattern.argument); + this.restElements.pop(); + } + + MemberExpression(node) { + + // Computed property's key is a right hand node. + if (node.computed) { + this.rightHandNodes.push(node.property); + } + + // the object is only read, write to its property. + this.rightHandNodes.push(node.object); + } + + // + // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression. + // By spec, LeftHandSideExpression is Pattern or MemberExpression. + // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758) + // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc... + // + + SpreadElement(node) { + this.visit(node.argument); + } + + ArrayExpression(node) { + node.elements.forEach(this.visit, this); + } + + AssignmentExpression(node) { + this.assignments.push(node); + this.visit(node.left); + this.rightHandNodes.push(node.right); + this.assignments.pop(); + } + + CallExpression(node) { + + // arguments are right hand nodes. + node.arguments.forEach(a => { + this.rightHandNodes.push(a); + }); + this.visit(node.callee); + } +} + +module.exports = PatternVisitor; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/reference.js b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/reference.js new file mode 100644 index 00000000000000..9529827fe786c6 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/reference.js @@ -0,0 +1,167 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +const READ = 0x1; +const WRITE = 0x2; +const RW = READ | WRITE; + +/** + * A Reference represents a single occurrence of an identifier in code. + * @class Reference + */ +class Reference { + constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) { + + /** + * Identifier syntax node. + * @member {espreeIdentifier} Reference#identifier + */ + this.identifier = ident; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Reference#from + */ + this.from = scope; + + /** + * Whether the reference comes from a dynamic scope (such as 'eval', + * 'with', etc.), and may be trapped by dynamic scopes. + * @member {boolean} Reference#tainted + */ + this.tainted = false; + + /** + * The variable this reference is resolved with. + * @member {Variable} Reference#resolved + */ + this.resolved = null; + + /** + * The read-write mode of the reference. (Value is one of {@link + * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}). + * @member {number} Reference#flag + * @private + */ + this.flag = flag; + if (this.isWrite()) { + + /** + * If reference is writeable, this is the tree being written to it. + * @member {espreeNode} Reference#writeExpr + */ + this.writeExpr = writeExpr; + + /** + * Whether the Reference might refer to a partial value of writeExpr. + * @member {boolean} Reference#partial + */ + this.partial = partial; + + /** + * Whether the Reference is to write of initialization. + * @member {boolean} Reference#init + */ + this.init = init; + } + this.__maybeImplicitGlobal = maybeImplicitGlobal; + } + + /** + * Whether the reference is static. + * @method Reference#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.tainted && this.resolved && this.resolved.scope.isStatic(); + } + + /** + * Whether the reference is writeable. + * @method Reference#isWrite + * @returns {boolean} write + */ + isWrite() { + return !!(this.flag & Reference.WRITE); + } + + /** + * Whether the reference is readable. + * @method Reference#isRead + * @returns {boolean} read + */ + isRead() { + return !!(this.flag & Reference.READ); + } + + /** + * Whether the reference is read-only. + * @method Reference#isReadOnly + * @returns {boolean} read only + */ + isReadOnly() { + return this.flag === Reference.READ; + } + + /** + * Whether the reference is write-only. + * @method Reference#isWriteOnly + * @returns {boolean} write only + */ + isWriteOnly() { + return this.flag === Reference.WRITE; + } + + /** + * Whether the reference is read-write. + * @method Reference#isReadWrite + * @returns {boolean} read write + */ + isReadWrite() { + return this.flag === Reference.RW; + } +} + +/** + * @constant Reference.READ + * @private + */ +Reference.READ = READ; + +/** + * @constant Reference.WRITE + * @private + */ +Reference.WRITE = WRITE; + +/** + * @constant Reference.RW + * @private + */ +Reference.RW = RW; + +module.exports = Reference; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/referencer.js b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/referencer.js new file mode 100644 index 00000000000000..63d1935b3a957f --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/referencer.js @@ -0,0 +1,629 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-underscore-dangle */ +/* eslint-disable no-undefined */ + +const Syntax = require("estraverse").Syntax; +const esrecurse = require("esrecurse"); +const Reference = require("./reference"); +const Variable = require("./variable"); +const PatternVisitor = require("./pattern-visitor"); +const definition = require("./definition"); +const assert = require("assert"); + +const ParameterDefinition = definition.ParameterDefinition; +const Definition = definition.Definition; + +/** + * Traverse identifier in pattern + * @param {Object} options - options + * @param {pattern} rootPattern - root pattern + * @param {Refencer} referencer - referencer + * @param {callback} callback - callback + * @returns {void} + */ +function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { + + // Call the callback at left hand identifier nodes, and Collect right hand nodes. + const visitor = new PatternVisitor(options, rootPattern, callback); + + visitor.visit(rootPattern); + + // Process the right hand nodes recursively. + if (referencer !== null && referencer !== undefined) { + visitor.rightHandNodes.forEach(referencer.visit, referencer); + } +} + +// Importing ImportDeclaration. +// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation +// https://github.com/estree/estree/blob/master/es6.md#importdeclaration +// FIXME: Now, we don't create module environment, because the context is +// implementation dependent. + +class Importer extends esrecurse.Visitor { + constructor(declaration, referencer) { + super(null, referencer.options); + this.declaration = declaration; + this.referencer = referencer; + } + + visitImport(id, specifier) { + this.referencer.visitPattern(id, pattern => { + this.referencer.currentScope().__define(pattern, + new Definition( + Variable.ImportBinding, + pattern, + specifier, + this.declaration, + null, + null + )); + }); + } + + ImportNamespaceSpecifier(node) { + const local = (node.local || node.id); + + if (local) { + this.visitImport(local, node); + } + } + + ImportDefaultSpecifier(node) { + const local = (node.local || node.id); + + this.visitImport(local, node); + } + + ImportSpecifier(node) { + const local = (node.local || node.id); + + if (node.name) { + this.visitImport(node.name, node); + } else { + this.visitImport(local, node); + } + } +} + +// Referencing variables and creating bindings. +class Referencer extends esrecurse.Visitor { + constructor(options, scopeManager) { + super(null, options); + this.options = options; + this.scopeManager = scopeManager; + this.parent = null; + this.isInnerMethodDefinition = false; + } + + currentScope() { + return this.scopeManager.__currentScope; + } + + close(node) { + while (this.currentScope() && node === this.currentScope().block) { + this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager); + } + } + + pushInnerMethodDefinition(isInnerMethodDefinition) { + const previous = this.isInnerMethodDefinition; + + this.isInnerMethodDefinition = isInnerMethodDefinition; + return previous; + } + + popInnerMethodDefinition(isInnerMethodDefinition) { + this.isInnerMethodDefinition = isInnerMethodDefinition; + } + + referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { + const scope = this.currentScope(); + + assignments.forEach(assignment => { + scope.__referencing( + pattern, + Reference.WRITE, + assignment.right, + maybeImplicitGlobal, + pattern !== assignment.left, + init + ); + }); + } + + visitPattern(node, options, callback) { + let visitPatternOptions = options; + let visitPatternCallback = callback; + + if (typeof options === "function") { + visitPatternCallback = options; + visitPatternOptions = { processRightHandNodes: false }; + } + + traverseIdentifierInPattern( + this.options, + node, + visitPatternOptions.processRightHandNodes ? this : null, + visitPatternCallback + ); + } + + visitFunction(node) { + let i, iz; + + // FunctionDeclaration name is defined in upper scope + // NOTE: Not referring variableScope. It is intended. + // Since + // in ES5, FunctionDeclaration should be in FunctionBody. + // in ES6, FunctionDeclaration should be block scoped. + + if (node.type === Syntax.FunctionDeclaration) { + + // id is defined in upper scope + this.currentScope().__define(node.id, + new Definition( + Variable.FunctionName, + node.id, + node, + null, + null, + null + )); + } + + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + if (node.type === Syntax.FunctionExpression && node.id) { + this.scopeManager.__nestFunctionExpressionNameScope(node); + } + + // Consider this function is in the MethodDefinition. + this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); + + const that = this; + + /** + * Visit pattern callback + * @param {pattern} pattern - pattern + * @param {Object} info - info + * @returns {void} + */ + function visitPatternCallback(pattern, info) { + that.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + i, + info.rest + )); + + that.referencingDefaultValue(pattern, info.assignments, null, true); + } + + // Process parameter declarations. + for (i = 0, iz = node.params.length; i < iz; ++i) { + this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback); + } + + // if there's a rest argument, add that + if (node.rest) { + this.visitPattern({ + type: "RestElement", + argument: node.rest + }, pattern => { + this.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + node.params.length, + true + )); + }); + } + + // In TypeScript there are a number of function-like constructs which have no body, + // so check it exists before traversing + if (node.body) { + + // Skip BlockStatement to prevent creating BlockStatement scope. + if (node.body.type === Syntax.BlockStatement) { + this.visitChildren(node.body); + } else { + this.visit(node.body); + } + } + + this.close(node); + } + + visitClass(node) { + if (node.type === Syntax.ClassDeclaration) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node, + null, + null, + null + )); + } + + this.visit(node.superClass); + + this.scopeManager.__nestClassScope(node); + + if (node.id) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node + )); + } + this.visit(node.body); + + this.close(node); + } + + visitProperty(node) { + let previous; + + if (node.computed) { + this.visit(node.key); + } + + const isMethodDefinition = node.type === Syntax.MethodDefinition; + + if (isMethodDefinition) { + previous = this.pushInnerMethodDefinition(true); + } + this.visit(node.value); + if (isMethodDefinition) { + this.popInnerMethodDefinition(previous); + } + } + + visitForIn(node) { + if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + if (node.left.type === Syntax.VariableDeclaration) { + this.visit(node.left); + this.visitPattern(node.left.declarations[0].id, pattern => { + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true); + }); + } else { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false); + }); + } + this.visit(node.right); + this.visit(node.body); + + this.close(node); + } + + visitVariableDeclaration(variableTargetScope, type, node, index) { + + const decl = node.declarations[index]; + const init = decl.init; + + this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => { + variableTargetScope.__define( + pattern, + new Definition( + type, + pattern, + decl, + node, + index, + node.kind + ) + ); + + this.referencingDefaultValue(pattern, info.assignments, null, true); + if (init) { + this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true); + } + }); + } + + AssignmentExpression(node) { + if (PatternVisitor.isPattern(node.left)) { + if (node.operator === "=") { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false); + }); + } else { + this.currentScope().__referencing(node.left, Reference.RW, node.right); + } + } else { + this.visit(node.left); + } + this.visit(node.right); + } + + CatchClause(node) { + this.scopeManager.__nestCatchScope(node); + + this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => { + this.currentScope().__define(pattern, + new Definition( + Variable.CatchClause, + node.param, + node, + null, + null, + null + )); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }); + this.visit(node.body); + + this.close(node); + } + + Program(node) { + this.scopeManager.__nestGlobalScope(node); + + if (this.scopeManager.__isNodejsScope()) { + + // Force strictness of GlobalScope to false when using node.js scope. + this.currentScope().isStrict = false; + this.scopeManager.__nestFunctionScope(node, false); + } + + if (this.scopeManager.__isES6() && this.scopeManager.isModule()) { + this.scopeManager.__nestModuleScope(node); + } + + if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) { + this.currentScope().isStrict = true; + } + + this.visitChildren(node); + this.close(node); + } + + Identifier(node) { + this.currentScope().__referencing(node); + } + + UpdateExpression(node) { + if (PatternVisitor.isPattern(node.argument)) { + this.currentScope().__referencing(node.argument, Reference.RW, null); + } else { + this.visitChildren(node); + } + } + + MemberExpression(node) { + this.visit(node.object); + if (node.computed) { + this.visit(node.property); + } + } + + Property(node) { + this.visitProperty(node); + } + + MethodDefinition(node) { + this.visitProperty(node); + } + + BreakStatement() {} // eslint-disable-line class-methods-use-this + + ContinueStatement() {} // eslint-disable-line class-methods-use-this + + LabeledStatement(node) { + this.visit(node.body); + } + + ForStatement(node) { + + // Create ForStatement declaration. + // NOTE: In ES6, ForStatement dynamically generates + // per iteration environment. However, escope is + // a static analyzer, we only generate one scope for ForStatement. + if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ClassExpression(node) { + this.visitClass(node); + } + + ClassDeclaration(node) { + this.visitClass(node); + } + + CallExpression(node) { + + // Check this is direct call to eval + if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") { + + // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and + // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment. + this.currentScope().variableScope.__detectEval(); + } + this.visitChildren(node); + } + + BlockStatement(node) { + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestBlockScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ThisExpression() { + this.currentScope().variableScope.__detectThis(); + } + + WithStatement(node) { + this.visit(node.object); + + // Then nest scope for WithStatement. + this.scopeManager.__nestWithScope(node); + + this.visit(node.body); + + this.close(node); + } + + VariableDeclaration(node) { + const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope(); + + for (let i = 0, iz = node.declarations.length; i < iz; ++i) { + const decl = node.declarations[i]; + + this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i); + if (decl.init) { + this.visit(decl.init); + } + } + } + + // sec 13.11.8 + SwitchStatement(node) { + this.visit(node.discriminant); + + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestSwitchScope(node); + } + + for (let i = 0, iz = node.cases.length; i < iz; ++i) { + this.visit(node.cases[i]); + } + + this.close(node); + } + + FunctionDeclaration(node) { + this.visitFunction(node); + } + + FunctionExpression(node) { + this.visitFunction(node); + } + + ForOfStatement(node) { + this.visitForIn(node); + } + + ForInStatement(node) { + this.visitForIn(node); + } + + ArrowFunctionExpression(node) { + this.visitFunction(node); + } + + ImportDeclaration(node) { + assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context."); + + const importer = new Importer(node, this); + + importer.visit(node); + } + + visitExportDeclaration(node) { + if (node.source) { + return; + } + if (node.declaration) { + this.visit(node.declaration); + return; + } + + this.visitChildren(node); + } + + // TODO: ExportDeclaration doesn't exist. for bc? + ExportDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportAllDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportDefaultDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportNamedDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportSpecifier(node) { + + // TODO: `node.id` doesn't exist. for bc? + const local = (node.id || node.local); + + this.visit(local); + } + + MetaProperty() { // eslint-disable-line class-methods-use-this + + // do nothing. + } +} + +module.exports = Referencer; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/scope-manager.js b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/scope-manager.js new file mode 100644 index 00000000000000..c1927994b1166e --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/scope-manager.js @@ -0,0 +1,247 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-underscore-dangle */ + +const Scope = require("./scope"); +const assert = require("assert"); + +const GlobalScope = Scope.GlobalScope; +const CatchScope = Scope.CatchScope; +const WithScope = Scope.WithScope; +const ModuleScope = Scope.ModuleScope; +const ClassScope = Scope.ClassScope; +const SwitchScope = Scope.SwitchScope; +const FunctionScope = Scope.FunctionScope; +const ForScope = Scope.ForScope; +const FunctionExpressionNameScope = Scope.FunctionExpressionNameScope; +const BlockScope = Scope.BlockScope; + +/** + * @class ScopeManager + */ +class ScopeManager { + constructor(options) { + this.scopes = []; + this.globalScope = null; + this.__nodeToScope = new WeakMap(); + this.__currentScope = null; + this.__options = options; + this.__declaredVariables = new WeakMap(); + } + + __useDirective() { + return this.__options.directive; + } + + __isOptimistic() { + return this.__options.optimistic; + } + + __ignoreEval() { + return this.__options.ignoreEval; + } + + __isNodejsScope() { + return this.__options.nodejsScope; + } + + isModule() { + return this.__options.sourceType === "module"; + } + + isImpliedStrict() { + return this.__options.impliedStrict; + } + + isStrictModeSupported() { + return this.__options.ecmaVersion >= 5; + } + + // Returns appropriate scope for this node. + __get(node) { + return this.__nodeToScope.get(node); + } + + /** + * Get variables that are declared by the node. + * + * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`. + * If the node declares nothing, this method returns an empty array. + * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details. + * + * @param {Espree.Node} node - a node to get. + * @returns {Variable[]} variables that declared by the node. + */ + getDeclaredVariables(node) { + return this.__declaredVariables.get(node) || []; + } + + /** + * acquire scope from node. + * @method ScopeManager#acquire + * @param {Espree.Node} node - node for the acquired scope. + * @param {boolean=} inner - look up the most inner scope, default value is false. + * @returns {Scope?} Scope from node + */ + acquire(node, inner) { + + /** + * predicate + * @param {Scope} testScope - scope to test + * @returns {boolean} predicate + */ + function predicate(testScope) { + if (testScope.type === "function" && testScope.functionExpressionScope) { + return false; + } + return true; + } + + const scopes = this.__get(node); + + if (!scopes || scopes.length === 0) { + return null; + } + + // Heuristic selection from all scopes. + // If you would like to get all scopes, please use ScopeManager#acquireAll. + if (scopes.length === 1) { + return scopes[0]; + } + + if (inner) { + for (let i = scopes.length - 1; i >= 0; --i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } else { + for (let i = 0, iz = scopes.length; i < iz; ++i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } + + return null; + } + + /** + * acquire all scopes from node. + * @method ScopeManager#acquireAll + * @param {Espree.Node} node - node for the acquired scope. + * @returns {Scopes?} Scope array + */ + acquireAll(node) { + return this.__get(node); + } + + /** + * release the node. + * @method ScopeManager#release + * @param {Espree.Node} node - releasing node. + * @param {boolean=} inner - look up the most inner scope, default value is false. + * @returns {Scope?} upper scope for the node. + */ + release(node, inner) { + const scopes = this.__get(node); + + if (scopes && scopes.length) { + const scope = scopes[0].upper; + + if (!scope) { + return null; + } + return this.acquire(scope.block, inner); + } + return null; + } + + attach() { } // eslint-disable-line class-methods-use-this + + detach() { } // eslint-disable-line class-methods-use-this + + __nestScope(scope) { + if (scope instanceof GlobalScope) { + assert(this.__currentScope === null); + this.globalScope = scope; + } + this.__currentScope = scope; + return scope; + } + + __nestGlobalScope(node) { + return this.__nestScope(new GlobalScope(this, node)); + } + + __nestBlockScope(node) { + return this.__nestScope(new BlockScope(this, this.__currentScope, node)); + } + + __nestFunctionScope(node, isMethodDefinition) { + return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition)); + } + + __nestForScope(node) { + return this.__nestScope(new ForScope(this, this.__currentScope, node)); + } + + __nestCatchScope(node) { + return this.__nestScope(new CatchScope(this, this.__currentScope, node)); + } + + __nestWithScope(node) { + return this.__nestScope(new WithScope(this, this.__currentScope, node)); + } + + __nestClassScope(node) { + return this.__nestScope(new ClassScope(this, this.__currentScope, node)); + } + + __nestSwitchScope(node) { + return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); + } + + __nestModuleScope(node) { + return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); + } + + __nestFunctionExpressionNameScope(node) { + return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node)); + } + + __isES6() { + return this.__options.ecmaVersion >= 6; + } +} + +module.exports = ScopeManager; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/scope.js b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/scope.js new file mode 100644 index 00000000000000..5c4c967780a3e5 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/scope.js @@ -0,0 +1,748 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-underscore-dangle */ +/* eslint-disable no-undefined */ + +const Syntax = require("estraverse").Syntax; + +const Reference = require("./reference"); +const Variable = require("./variable"); +const Definition = require("./definition").Definition; +const assert = require("assert"); + +/** + * Test if scope is struct + * @param {Scope} scope - scope + * @param {Block} block - block + * @param {boolean} isMethodDefinition - is method definiton + * @param {boolean} useDirective - use directive + * @returns {boolean} is strict scope + */ +function isStrictScope(scope, block, isMethodDefinition, useDirective) { + let body; + + // When upper scope is exists and strict, inner scope is also strict. + if (scope.upper && scope.upper.isStrict) { + return true; + } + + if (isMethodDefinition) { + return true; + } + + if (scope.type === "class" || scope.type === "module") { + return true; + } + + if (scope.type === "block" || scope.type === "switch") { + return false; + } + + if (scope.type === "function") { + if (block.type === Syntax.ArrowFunctionExpression && block.body.type !== Syntax.BlockStatement) { + return false; + } + + if (block.type === Syntax.Program) { + body = block; + } else { + body = block.body; + } + + if (!body) { + return false; + } + } else if (scope.type === "global") { + body = block; + } else { + return false; + } + + // Search 'use strict' directive. + if (useDirective) { + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + if (stmt.type !== Syntax.DirectiveStatement) { + break; + } + if (stmt.raw === "\"use strict\"" || stmt.raw === "'use strict'") { + return true; + } + } + } else { + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + if (stmt.type !== Syntax.ExpressionStatement) { + break; + } + const expr = stmt.expression; + + if (expr.type !== Syntax.Literal || typeof expr.value !== "string") { + break; + } + if (expr.raw !== null && expr.raw !== undefined) { + if (expr.raw === "\"use strict\"" || expr.raw === "'use strict'") { + return true; + } + } else { + if (expr.value === "use strict") { + return true; + } + } + } + } + return false; +} + +/** + * Register scope + * @param {ScopeManager} scopeManager - scope manager + * @param {Scope} scope - scope + * @returns {void} + */ +function registerScope(scopeManager, scope) { + scopeManager.scopes.push(scope); + + const scopes = scopeManager.__nodeToScope.get(scope.block); + + if (scopes) { + scopes.push(scope); + } else { + scopeManager.__nodeToScope.set(scope.block, [scope]); + } +} + +/** + * Should be statically + * @param {Object} def - def + * @returns {boolean} should be statically + */ +function shouldBeStatically(def) { + return ( + (def.type === Variable.ClassName) || + (def.type === Variable.Variable && def.parent.kind !== "var") + ); +} + +/** + * @class Scope + */ +class Scope { + constructor(scopeManager, type, upperScope, block, isMethodDefinition) { + + /** + * One of 'module', 'block', 'switch', 'function', 'catch', 'with', 'function', 'class', 'global'. + * @member {String} Scope#type + */ + this.type = type; + + /** + * The scoped {@link Variable}s of this scope, as { Variable.name + * : Variable }. + * @member {Map} Scope#set + */ + this.set = new Map(); + + /** + * The tainted variables of this scope, as { Variable.name : + * boolean }. + * @member {Map} Scope#taints */ + this.taints = new Map(); + + /** + * Generally, through the lexical scoping of JS you can always know + * which variable an identifier in the source code refers to. There are + * a few exceptions to this rule. With 'global' and 'with' scopes you + * can only decide at runtime which variable a reference refers to. + * Moreover, if 'eval()' is used in a scope, it might introduce new + * bindings in this or its parent scopes. + * All those scopes are considered 'dynamic'. + * @member {boolean} Scope#dynamic + */ + this.dynamic = this.type === "global" || this.type === "with"; + + /** + * A reference to the scope-defining syntax node. + * @member {espree.Node} Scope#block + */ + this.block = block; + + /** + * The {@link Reference|references} that are not resolved with this scope. + * @member {Reference[]} Scope#through + */ + this.through = []; + + /** + * The scoped {@link Variable}s of this scope. In the case of a + * 'function' scope this includes the automatic argument arguments as + * its first element, as well as all further formal arguments. + * @member {Variable[]} Scope#variables + */ + this.variables = []; + + /** + * Any variable {@link Reference|reference} found in this scope. This + * includes occurrences of local variables as well as variables from + * parent scopes (including the global scope). For local variables + * this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the + * formal parameter in the parameter list. + * @member {Reference[]} Scope#references + */ + this.references = []; + + /** + * For 'global' and 'function' scopes, this is a self-reference. For + * other scope types this is the variableScope value of the + * parent scope. + * @member {Scope} Scope#variableScope + */ + this.variableScope = + (this.type === "global" || this.type === "function" || this.type === "module") ? this : upperScope.variableScope; + + /** + * Whether this scope is created by a FunctionExpression. + * @member {boolean} Scope#functionExpressionScope + */ + this.functionExpressionScope = false; + + /** + * Whether this is a scope that contains an 'eval()' invocation. + * @member {boolean} Scope#directCallToEvalScope + */ + this.directCallToEvalScope = false; + + /** + * @member {boolean} Scope#thisFound + */ + this.thisFound = false; + + this.__left = []; + + /** + * Reference to the parent {@link Scope|scope}. + * @member {Scope} Scope#upper + */ + this.upper = upperScope; + + /** + * Whether 'use strict' is in effect in this scope. + * @member {boolean} Scope#isStrict + */ + this.isStrict = isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective()); + + /** + * List of nested {@link Scope}s. + * @member {Scope[]} Scope#childScopes + */ + this.childScopes = []; + if (this.upper) { + this.upper.childScopes.push(this); + } + + this.__declaredVariables = scopeManager.__declaredVariables; + + registerScope(scopeManager, this); + } + + __shouldStaticallyClose(scopeManager) { + return (!this.dynamic || scopeManager.__isOptimistic()); + } + + __shouldStaticallyCloseForGlobal(ref) { + + // On global scope, let/const/class declarations should be resolved statically. + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + + const variable = this.set.get(name); + const defs = variable.defs; + + return defs.length > 0 && defs.every(shouldBeStatically); + } + + __staticCloseRef(ref) { + if (!this.__resolve(ref)) { + this.__delegateToUpperScope(ref); + } + } + + __dynamicCloseRef(ref) { + + // notify all names are through to global + let current = this; + + do { + current.through.push(ref); + current = current.upper; + } while (current); + } + + __globalCloseRef(ref) { + + // let/const/class declarations should be resolved statically. + // others should be resolved dynamically. + if (this.__shouldStaticallyCloseForGlobal(ref)) { + this.__staticCloseRef(ref); + } else { + this.__dynamicCloseRef(ref); + } + } + + __close(scopeManager) { + let closeRef; + + if (this.__shouldStaticallyClose(scopeManager)) { + closeRef = this.__staticCloseRef; + } else if (this.type !== "global") { + closeRef = this.__dynamicCloseRef; + } else { + closeRef = this.__globalCloseRef; + } + + // Try Resolving all references in this scope. + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + closeRef.call(this, ref); + } + this.__left = null; + + return this.upper; + } + + // To override by function scopes. + // References in default parameters isn't resolved to variables which are in their function body. + __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars + return true; + } + + __resolve(ref) { + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + const variable = this.set.get(name); + + if (!this.__isValidResolution(ref, variable)) { + return false; + } + variable.references.push(ref); + variable.stack = variable.stack && ref.from.variableScope === this.variableScope; + if (ref.tainted) { + variable.tainted = true; + this.taints.set(variable.name, true); + } + ref.resolved = variable; + + return true; + } + + __delegateToUpperScope(ref) { + if (this.upper) { + this.upper.__left.push(ref); + } + this.through.push(ref); + } + + __addDeclaredVariablesOfNode(variable, node) { + if (node === null || node === undefined) { + return; + } + + let variables = this.__declaredVariables.get(node); + + if (variables === null || variables === undefined) { + variables = []; + this.__declaredVariables.set(node, variables); + } + if (variables.indexOf(variable) === -1) { + variables.push(variable); + } + } + + __defineGeneric(name, set, variables, node, def) { + let variable; + + variable = set.get(name); + if (!variable) { + variable = new Variable(name, this); + set.set(name, variable); + variables.push(variable); + } + + if (def) { + variable.defs.push(def); + this.__addDeclaredVariablesOfNode(variable, def.node); + this.__addDeclaredVariablesOfNode(variable, def.parent); + } + if (node) { + variable.identifiers.push(node); + } + } + + __define(node, def) { + if (node && node.type === Syntax.Identifier) { + this.__defineGeneric( + node.name, + this.set, + this.variables, + node, + def + ); + } + } + + __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) { + + // because Array element may be null + if (!node || node.type !== Syntax.Identifier) { + return; + } + + // Specially handle like `this`. + if (node.name === "super") { + return; + } + + const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init); + + this.references.push(ref); + this.__left.push(ref); + } + + __detectEval() { + let current = this; + + this.directCallToEvalScope = true; + do { + current.dynamic = true; + current = current.upper; + } while (current); + } + + __detectThis() { + this.thisFound = true; + } + + __isClosed() { + return this.__left === null; + } + + /** + * returns resolved {Reference} + * @method Scope#resolve + * @param {Espree.Identifier} ident - identifier to be resolved. + * @returns {Reference} reference + */ + resolve(ident) { + let ref, i, iz; + + assert(this.__isClosed(), "Scope should be closed."); + assert(ident.type === Syntax.Identifier, "Target should be identifier."); + for (i = 0, iz = this.references.length; i < iz; ++i) { + ref = this.references[i]; + if (ref.identifier === ident) { + return ref; + } + } + return null; + } + + /** + * returns this scope is static + * @method Scope#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.dynamic; + } + + /** + * returns this scope has materialized arguments + * @method Scope#isArgumentsMaterialized + * @returns {boolean} arguemnts materialized + */ + isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this + return true; + } + + /** + * returns this scope has materialized `this` reference + * @method Scope#isThisMaterialized + * @returns {boolean} this materialized + */ + isThisMaterialized() { // eslint-disable-line class-methods-use-this + return true; + } + + isUsedName(name) { + if (this.set.has(name)) { + return true; + } + for (let i = 0, iz = this.through.length; i < iz; ++i) { + if (this.through[i].identifier.name === name) { + return true; + } + } + return false; + } +} + +class GlobalScope extends Scope { + constructor(scopeManager, block) { + super(scopeManager, "global", null, block, false); + this.implicit = { + set: new Map(), + variables: [], + + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + * @member {Reference[]} Scope#implicit#left + */ + left: [] + }; + } + + __close(scopeManager) { + const implicit = []; + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { + implicit.push(ref.__maybeImplicitGlobal); + } + } + + // create an implicit global variable from assignment expression + for (let i = 0, iz = implicit.length; i < iz; ++i) { + const info = implicit[i]; + + this.__defineImplicit(info.pattern, + new Definition( + Variable.ImplicitGlobalVariable, + info.pattern, + info.node, + null, + null, + null + )); + + } + + this.implicit.left = this.__left; + + return super.__close(scopeManager); + } + + __defineImplicit(node, def) { + if (node && node.type === Syntax.Identifier) { + this.__defineGeneric( + node.name, + this.implicit.set, + this.implicit.variables, + node, + def + ); + } + } +} + +class ModuleScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "module", upperScope, block, false); + } +} + +class FunctionExpressionNameScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "function-expression-name", upperScope, block, false); + this.__define(block.id, + new Definition( + Variable.FunctionName, + block.id, + block, + null, + null, + null + )); + this.functionExpressionScope = true; + } +} + +class CatchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "catch", upperScope, block, false); + } +} + +class WithScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "with", upperScope, block, false); + } + + __close(scopeManager) { + if (this.__shouldStaticallyClose(scopeManager)) { + return super.__close(scopeManager); + } + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + ref.tainted = true; + this.__delegateToUpperScope(ref); + } + this.__left = null; + + return this.upper; + } +} + +class BlockScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "block", upperScope, block, false); + } +} + +class SwitchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "switch", upperScope, block, false); + } +} + +class FunctionScope extends Scope { + constructor(scopeManager, upperScope, block, isMethodDefinition) { + super(scopeManager, "function", upperScope, block, isMethodDefinition); + + // section 9.2.13, FunctionDeclarationInstantiation. + // NOTE Arrow functions never have an arguments objects. + if (this.block.type !== Syntax.ArrowFunctionExpression) { + this.__defineArguments(); + } + } + + isArgumentsMaterialized() { + + // TODO(Constellation) + // We can more aggressive on this condition like this. + // + // function t() { + // // arguments of t is always hidden. + // function arguments() { + // } + // } + if (this.block.type === Syntax.ArrowFunctionExpression) { + return false; + } + + if (!this.isStatic()) { + return true; + } + + const variable = this.set.get("arguments"); + + assert(variable, "Always have arguments variable."); + return variable.tainted || variable.references.length !== 0; + } + + isThisMaterialized() { + if (!this.isStatic()) { + return true; + } + return this.thisFound; + } + + __defineArguments() { + this.__defineGeneric( + "arguments", + this.set, + this.variables, + null, + null + ); + this.taints.set("arguments", true); + } + + // References in default parameters isn't resolved to variables which are in their function body. + // const x = 1 + // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. + // const x = 2 + // console.log(a) + // } + __isValidResolution(ref, variable) { + + // If `options.nodejsScope` is true, `this.block` becomes a Program node. + if (this.block.type === "Program") { + return true; + } + + const bodyStart = this.block.body.range[0]; + + // It's invalid resolution in the following case: + return !( + variable.scope === this && + ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. + variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body. + ); + } +} + +class ForScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "for", upperScope, block, false); + } +} + +class ClassScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class", upperScope, block, false); + } +} + +module.exports = { + Scope, + GlobalScope, + ModuleScope, + FunctionExpressionNameScope, + CatchScope, + WithScope, + BlockScope, + SwitchScope, + FunctionScope, + ForScope, + ClassScope +}; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/variable.js b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/variable.js new file mode 100644 index 00000000000000..702c4780a248a3 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/variable.js @@ -0,0 +1,88 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/** + * A Variable represents a locally scoped identifier. These include arguments to + * functions. + * @class Variable + */ +class Variable { + constructor(name, scope) { + + /** + * The variable name, as given in the source code. + * @member {String} Variable#name + */ + this.name = name; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as AST nodes. + * @member {espree.Identifier[]} Variable#identifiers + */ + this.identifiers = []; + + /** + * List of {@link Reference|references} of this variable (excluding parameter entries) + * in its defining scope and all nested scopes. For defining + * occurrences only see {@link Variable#defs}. + * @member {Reference[]} Variable#references + */ + this.references = []; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as custom objects. + * @member {Definition[]} Variable#defs + */ + this.defs = []; + + this.tainted = false; + + /** + * Whether this is a stack variable. + * @member {boolean} Variable#stack + */ + this.stack = true; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Variable#scope + */ + this.scope = scope; + } +} + +Variable.CatchClause = "CatchClause"; +Variable.Parameter = "Parameter"; +Variable.FunctionName = "FunctionName"; +Variable.ClassName = "ClassName"; +Variable.Variable = "Variable"; +Variable.ImportBinding = "ImportBinding"; +Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable"; + +module.exports = Variable; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/package.json b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/package.json new file mode 100644 index 00000000000000..a19fd8ce712203 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/package.json @@ -0,0 +1,48 @@ +{ + "name": "eslint-scope", + "description": "ECMAScript scope analyzer for ESLint", + "homepage": "http://github.com/eslint/eslint-scope", + "main": "lib/index.js", + "version": "5.1.0", + "engines": { + "node": ">=8.0.0" + }, + "repository": "eslint/eslint-scope", + "bugs": { + "url": "https://github.com/eslint/eslint-scope/issues" + }, + "license": "BSD-2-Clause", + "scripts": { + "test": "node Makefile.js test", + "lint": "node Makefile.js lint", + "generate-release": "eslint-generate-release", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "publish-release": "eslint-publish-release" + }, + "files": [ + "LICENSE", + "README.md", + "lib" + ], + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "devDependencies": { + "@typescript-eslint/parser": "^1.11.0", + "chai": "^4.2.0", + "eslint": "^6.0.1", + "eslint-config-eslint": "^5.0.1", + "eslint-plugin-node": "^9.1.0", + "eslint-release": "^1.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", + "istanbul": "^0.4.5", + "mocha": "^6.1.4", + "npm-license": "^0.3.3", + "shelljs": "^0.8.3", + "typescript": "^3.5.2" + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/LICENSE b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/LICENSE rename to tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/LICENSE diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/README.md b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/README.md rename to tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/README.md diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/lib/index.js b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/lib/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/lib/index.js rename to tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/lib/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/lib/visitor-keys.json similarity index 98% rename from tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json rename to tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/lib/visitor-keys.json index d31b7b29439a13..a33bbc66005b6a 100644 --- a/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/lib/visitor-keys.json @@ -38,6 +38,9 @@ "param", "body" ], + "ChainExpression": [ + "expression" + ], "ClassBody": [ "body" ], @@ -66,6 +69,7 @@ ], "EmptyStatement": [], "ExportAllDeclaration": [ + "exported", "source" ], "ExportDefaultDeclaration": [ diff --git a/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/package.json similarity index 73% rename from tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/package.json rename to tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/package.json index 68eec940691e0b..63267be6437e03 100644 --- a/tools/node_modules/babel-eslint/node_modules/eslint-visitor-keys/package.json +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys/package.json @@ -1,15 +1,15 @@ { - "author": { - "name": "Toru Nagashima", - "url": "https://github.com/mysticatea" - }, - "bugs": { - "url": "https://github.com/eslint/eslint-visitor-keys/issues" + "name": "eslint-visitor-keys", + "version": "1.3.0", + "description": "Constants and utilities about visitor keys to traverse AST.", + "main": "lib/index.js", + "files": [ + "lib" + ], + "engines": { + "node": ">=4" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, - "description": "Constants and utilities about visitor keys to traverse AST.", "devDependencies": { "eslint": "^4.7.2", "eslint-config-eslint": "^4.0.0", @@ -18,31 +18,23 @@ "nyc": "^11.2.1", "opener": "^1.4.3" }, - "engines": { - "node": ">=4" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme", - "keywords": [], - "license": "Apache-2.0", - "main": "lib/index.js", - "name": "eslint-visitor-keys", - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint-visitor-keys.git" - }, "scripts": { + "lint": "eslint lib tests/lib", + "pretest": "npm run -s lint", + "test": "nyc mocha tests/lib", "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", + "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", "generate-rcrelease": "eslint-generate-prerelease rc", - "generate-release": "eslint-generate-release", - "lint": "eslint lib tests/lib", - "pretest": "npm run -s lint", - "publish-release": "eslint-publish-release", - "test": "nyc mocha tests/lib" + "publish-release": "eslint-publish-release" + }, + "repository": "eslint/eslint-visitor-keys", + "keywords": [], + "author": "Toru Nagashima (https://github.com/mysticatea)", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/eslint/eslint-visitor-keys/issues" }, - "version": "1.1.0" -} \ No newline at end of file + "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" +} diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/README.md b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/README.md new file mode 100644 index 00000000000000..ffea6b434a4a63 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/README.md @@ -0,0 +1,171 @@ +### Esrecurse [![Build Status](https://travis-ci.org/estools/esrecurse.svg?branch=master)](https://travis-ci.org/estools/esrecurse) + +Esrecurse ([esrecurse](https://github.com/estools/esrecurse)) is +[ECMAScript](https://www.ecma-international.org/publications/standards/Ecma-262.htm) +recursive traversing functionality. + +### Example Usage + +The following code will output all variables declared at the root of a file. + +```javascript +esrecurse.visit(ast, { + XXXStatement: function (node) { + this.visit(node.left); + // do something... + this.visit(node.right); + } +}); +``` + +We can use `Visitor` instance. + +```javascript +var visitor = new esrecurse.Visitor({ + XXXStatement: function (node) { + this.visit(node.left); + // do something... + this.visit(node.right); + } +}); + +visitor.visit(ast); +``` + +We can inherit `Visitor` instance easily. + +```javascript +class Derived extends esrecurse.Visitor { + constructor() + { + super(null); + } + + XXXStatement(node) { + } +} +``` + +```javascript +function DerivedVisitor() { + esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); +} +util.inherits(DerivedVisitor, esrecurse.Visitor); +DerivedVisitor.prototype.XXXStatement = function (node) { + this.visit(node.left); + // do something... + this.visit(node.right); +}; +``` + +And you can invoke default visiting operation inside custom visit operation. + +```javascript +function DerivedVisitor() { + esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); +} +util.inherits(DerivedVisitor, esrecurse.Visitor); +DerivedVisitor.prototype.XXXStatement = function (node) { + // do something... + this.visitChildren(node); +}; +``` + +The `childVisitorKeys` option does customize the behaviour of `this.visitChildren(node)`. +We can use user-defined node types. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +esrecurse.visit( + ast, + { + Literal: function (node) { + // do something... + } + }, + { + // Extending the existing traversing rules. + childVisitorKeys: { + // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] + TestExpression: ['argument'] + } + } +); +``` + +We can use the `fallback` option as well. +If the `fallback` option is `"iteration"`, `esrecurse` would visit all enumerable properties of unknown nodes. +Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). + +```javascript +esrecurse.visit( + ast, + { + Literal: function (node) { + // do something... + } + }, + { + fallback: 'iteration' + } +); +``` + +If the `fallback` option is a function, `esrecurse` calls this function to determine the enumerable properties of unknown nodes. +Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`). + +```javascript +esrecurse.visit( + ast, + { + Literal: function (node) { + // do something... + } + }, + { + fallback: function (node) { + return Object.keys(node).filter(function(key) { + return key !== 'argument' + }); + } + } +); +``` + +### License + +Copyright (C) 2014 [Yusuke Suzuki](https://github.com/Constellation) + (twitter: [@Constellation](https://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/esrecurse.js b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/esrecurse.js new file mode 100644 index 00000000000000..15d57dfd0218f6 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/esrecurse.js @@ -0,0 +1,117 @@ +/* + Copyright (C) 2014 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +(function () { + 'use strict'; + + var estraverse = require('estraverse'); + + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + + function isProperty(nodeType, key) { + return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties'; + } + + function Visitor(visitor, options) { + options = options || {}; + + this.__visitor = visitor || this; + this.__childVisitorKeys = options.childVisitorKeys + ? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys) + : estraverse.VisitorKeys; + if (options.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof options.fallback === 'function') { + this.__fallback = options.fallback; + } + } + + /* Default method for visiting children. + * When you need to call default visiting operation inside custom visiting + * operation, you can use it with `this.visitChildren(node)`. + */ + Visitor.prototype.visitChildren = function (node) { + var type, children, i, iz, j, jz, child; + + if (node == null) { + return; + } + + type = node.type || estraverse.Syntax.Property; + + children = this.__childVisitorKeys[type]; + if (!children) { + if (this.__fallback) { + children = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + type + '.'); + } + } + + for (i = 0, iz = children.length; i < iz; ++i) { + child = node[children[i]]; + if (child) { + if (Array.isArray(child)) { + for (j = 0, jz = child.length; j < jz; ++j) { + if (child[j]) { + if (isNode(child[j]) || isProperty(type, children[i])) { + this.visit(child[j]); + } + } + } + } else if (isNode(child)) { + this.visit(child); + } + } + } + }; + + /* Dispatching node. */ + Visitor.prototype.visit = function (node) { + var type; + + if (node == null) { + return; + } + + type = node.type || estraverse.Syntax.Property; + if (this.__visitor[type]) { + this.__visitor[type].call(this, node); + return; + } + this.visitChildren(node); + }; + + exports.version = require('./package.json').version; + exports.Visitor = Visitor; + exports.visit = function (node, visitor, options) { + var v = new Visitor(visitor, options); + v.visit(node); + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/esutils/LICENSE.BSD b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/esutils/LICENSE.BSD rename to tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/README.md b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/README.md new file mode 100644 index 00000000000000..ccd3377f3e9449 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/README.md @@ -0,0 +1,153 @@ +### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) + +Estraverse ([estraverse](http://github.com/estools/estraverse)) is +[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +traversal functions from [esmangle project](http://github.com/estools/esmangle). + +### Documentation + +You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). + +### Example Usage + +The following code will output all variables declared at the root of a file. + +```javascript +estraverse.traverse(ast, { + enter: function (node, parent) { + if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') + return estraverse.VisitorOption.Skip; + }, + leave: function (node, parent) { + if (node.type == 'VariableDeclarator') + console.log(node.id.name); + } +}); +``` + +We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. + +```javascript +estraverse.traverse(ast, { + enter: function (node) { + this.break(); + } +}); +``` + +And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. + +```javascript +result = estraverse.replace(tree, { + enter: function (node) { + // Replace it with replaced. + if (node.type === 'Literal') + return replaced; + } +}); +``` + +By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Extending the existing traversing rules. + keys: { + // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] + TestExpression: ['argument'] + } +}); +``` + +By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Iterating the child **nodes** of unknown nodes. + fallback: 'iteration' +}); +``` + +When `visitor.fallback` is a function, we can determine which keys to visit on each node. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Skip the `argument` property of each node + fallback: function(node) { + return Object.keys(node).filter(function(key) { + return key !== 'argument'; + }); + } +}); +``` + +### License + +Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) + (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/estraverse.js b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/estraverse.js new file mode 100644 index 00000000000000..93225bb0c4013e --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/estraverse.js @@ -0,0 +1,801 @@ +/* + Copyright (C) 2012-2013 Yusuke Suzuki + Copyright (C) 2012 Ariya Hidayat + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/*jslint vars:false, bitwise:true*/ +/*jshint indent:4*/ +/*global exports:true*/ +(function clone(exports) { + 'use strict'; + + var Syntax, + VisitorOption, + VisitorKeys, + BREAK, + SKIP, + REMOVE; + + function deepCopy(obj) { + var ret = {}, key, val; + for (key in obj) { + if (obj.hasOwnProperty(key)) { + val = obj[key]; + if (typeof val === 'object' && val !== null) { + ret[key] = deepCopy(val); + } else { + ret[key] = val; + } + } + } + return ret; + } + + // based on LLVM libc++ upper_bound / lower_bound + // MIT License + + function upperBound(array, func) { + var diff, len, i, current; + + len = array.length; + i = 0; + + while (len) { + diff = len >>> 1; + current = i + diff; + if (func(array[current])) { + len = diff; + } else { + i = current + 1; + len -= diff + 1; + } + } + return i; + } + + Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ChainExpression: 'ChainExpression', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. + ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DebuggerStatement: 'DebuggerStatement', + DirectiveStatement: 'DirectiveStatement', + DoWhileStatement: 'DoWhileStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + ForOfStatement: 'ForOfStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportExpression: 'ImportExpression', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + ModuleSpecifier: 'ModuleSpecifier', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + Program: 'Program', + Property: 'Property', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; + + VisitorKeys = { + AssignmentExpression: ['left', 'right'], + AssignmentPattern: ['left', 'right'], + ArrayExpression: ['elements'], + ArrayPattern: ['elements'], + ArrowFunctionExpression: ['params', 'body'], + AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. + BlockStatement: ['body'], + BinaryExpression: ['left', 'right'], + BreakStatement: ['label'], + CallExpression: ['callee', 'arguments'], + CatchClause: ['param', 'body'], + ChainExpression: ['expression'], + ClassBody: ['body'], + ClassDeclaration: ['id', 'superClass', 'body'], + ClassExpression: ['id', 'superClass', 'body'], + ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. + ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + ConditionalExpression: ['test', 'consequent', 'alternate'], + ContinueStatement: ['label'], + DebuggerStatement: [], + DirectiveStatement: [], + DoWhileStatement: ['body', 'test'], + EmptyStatement: [], + ExportAllDeclaration: ['source'], + ExportDefaultDeclaration: ['declaration'], + ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], + ExportSpecifier: ['exported', 'local'], + ExpressionStatement: ['expression'], + ForStatement: ['init', 'test', 'update', 'body'], + ForInStatement: ['left', 'right', 'body'], + ForOfStatement: ['left', 'right', 'body'], + FunctionDeclaration: ['id', 'params', 'body'], + FunctionExpression: ['id', 'params', 'body'], + GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + Identifier: [], + IfStatement: ['test', 'consequent', 'alternate'], + ImportExpression: ['source'], + ImportDeclaration: ['specifiers', 'source'], + ImportDefaultSpecifier: ['local'], + ImportNamespaceSpecifier: ['local'], + ImportSpecifier: ['imported', 'local'], + Literal: [], + LabeledStatement: ['label', 'body'], + LogicalExpression: ['left', 'right'], + MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], + MethodDefinition: ['key', 'value'], + ModuleSpecifier: [], + NewExpression: ['callee', 'arguments'], + ObjectExpression: ['properties'], + ObjectPattern: ['properties'], + Program: ['body'], + Property: ['key', 'value'], + RestElement: [ 'argument' ], + ReturnStatement: ['argument'], + SequenceExpression: ['expressions'], + SpreadElement: ['argument'], + Super: [], + SwitchStatement: ['discriminant', 'cases'], + SwitchCase: ['test', 'consequent'], + TaggedTemplateExpression: ['tag', 'quasi'], + TemplateElement: [], + TemplateLiteral: ['quasis', 'expressions'], + ThisExpression: [], + ThrowStatement: ['argument'], + TryStatement: ['block', 'handler', 'finalizer'], + UnaryExpression: ['argument'], + UpdateExpression: ['argument'], + VariableDeclaration: ['declarations'], + VariableDeclarator: ['id', 'init'], + WhileStatement: ['test', 'body'], + WithStatement: ['object', 'body'], + YieldExpression: ['argument'] + }; + + // unique id + BREAK = {}; + SKIP = {}; + REMOVE = {}; + + VisitorOption = { + Break: BREAK, + Skip: SKIP, + Remove: REMOVE + }; + + function Reference(parent, key) { + this.parent = parent; + this.key = key; + } + + Reference.prototype.replace = function replace(node) { + this.parent[this.key] = node; + }; + + Reference.prototype.remove = function remove() { + if (Array.isArray(this.parent)) { + this.parent.splice(this.key, 1); + return true; + } else { + this.replace(null); + return false; + } + }; + + function Element(node, path, wrap, ref) { + this.node = node; + this.path = path; + this.wrap = wrap; + this.ref = ref; + } + + function Controller() { } + + // API: + // return property path array from root to current node + Controller.prototype.path = function path() { + var i, iz, j, jz, result, element; + + function addToPath(result, path) { + if (Array.isArray(path)) { + for (j = 0, jz = path.length; j < jz; ++j) { + result.push(path[j]); + } + } else { + result.push(path); + } + } + + // root node + if (!this.__current.path) { + return null; + } + + // first node is sentinel, second node is root element + result = []; + for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { + element = this.__leavelist[i]; + addToPath(result, element.path); + } + addToPath(result, this.__current.path); + return result; + }; + + // API: + // return type of current node + Controller.prototype.type = function () { + var node = this.current(); + return node.type || this.__current.wrap; + }; + + // API: + // return array of parent elements + Controller.prototype.parents = function parents() { + var i, iz, result; + + // first node is sentinel + result = []; + for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { + result.push(this.__leavelist[i].node); + } + + return result; + }; + + // API: + // return current node + Controller.prototype.current = function current() { + return this.__current.node; + }; + + Controller.prototype.__execute = function __execute(callback, element) { + var previous, result; + + result = undefined; + + previous = this.__current; + this.__current = element; + this.__state = null; + if (callback) { + result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); + } + this.__current = previous; + + return result; + }; + + // API: + // notify control skip / break + Controller.prototype.notify = function notify(flag) { + this.__state = flag; + }; + + // API: + // skip child nodes of current node + Controller.prototype.skip = function () { + this.notify(SKIP); + }; + + // API: + // break traversals + Controller.prototype['break'] = function () { + this.notify(BREAK); + }; + + // API: + // remove node + Controller.prototype.remove = function () { + this.notify(REMOVE); + }; + + Controller.prototype.__initialize = function(root, visitor) { + this.visitor = visitor; + this.root = root; + this.__worklist = []; + this.__leavelist = []; + this.__current = null; + this.__state = null; + this.__fallback = null; + if (visitor.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof visitor.fallback === 'function') { + this.__fallback = visitor.fallback; + } + + this.__keys = VisitorKeys; + if (visitor.keys) { + this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); + } + }; + + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + + function isProperty(nodeType, key) { + return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; + } + + function candidateExistsInLeaveList(leavelist, candidate) { + for (var i = leavelist.length - 1; i >= 0; --i) { + if (leavelist[i].node === candidate) { + return true; + } + } + return false; + } + + Controller.prototype.traverse = function traverse(root, visitor) { + var worklist, + leavelist, + element, + node, + nodeType, + ret, + key, + current, + current2, + candidates, + candidate, + sentinel; + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + worklist.push(new Element(root, null, null, null)); + leavelist.push(new Element(null, null, null, null)); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + ret = this.__execute(visitor.leave, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + continue; + } + + if (element.node) { + + ret = this.__execute(visitor.enter, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || ret === SKIP) { + continue; + } + + node = element.node; + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + + if (candidateExistsInLeaveList(leavelist, candidate[current2])) { + continue; + } + + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', null); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, null); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + if (candidateExistsInLeaveList(leavelist, candidate)) { + continue; + } + + worklist.push(new Element(candidate, key, null, null)); + } + } + } + } + }; + + Controller.prototype.replace = function replace(root, visitor) { + var worklist, + leavelist, + node, + nodeType, + target, + element, + current, + current2, + candidates, + candidate, + sentinel, + outer, + key; + + function removeElem(element) { + var i, + key, + nextElem, + parent; + + if (element.ref.remove()) { + // When the reference is an element of an array. + key = element.ref.key; + parent = element.ref.parent; + + // If removed from array, then decrease following items' keys. + i = worklist.length; + while (i--) { + nextElem = worklist[i]; + if (nextElem.ref && nextElem.ref.parent === parent) { + if (nextElem.ref.key < key) { + break; + } + --nextElem.ref.key; + } + } + } + } + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + outer = { + root: root + }; + element = new Element(root, null, null, new Reference(outer, 'root')); + worklist.push(element); + leavelist.push(element); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + target = this.__execute(visitor.leave, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + continue; + } + + target = this.__execute(visitor.enter, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + element.node = target; + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + element.node = null; + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + + // node may be null + node = element.node; + if (!node) { + continue; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || target === SKIP) { + continue; + } + + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + worklist.push(new Element(candidate, key, null, new Reference(node, key))); + } + } + } + + return outer.root; + }; + + function traverse(root, visitor) { + var controller = new Controller(); + return controller.traverse(root, visitor); + } + + function replace(root, visitor) { + var controller = new Controller(); + return controller.replace(root, visitor); + } + + function extendCommentRange(comment, tokens) { + var target; + + target = upperBound(tokens, function search(token) { + return token.range[0] > comment.range[0]; + }); + + comment.extendedRange = [comment.range[0], comment.range[1]]; + + if (target !== tokens.length) { + comment.extendedRange[1] = tokens[target].range[0]; + } + + target -= 1; + if (target >= 0) { + comment.extendedRange[0] = tokens[target].range[1]; + } + + return comment; + } + + function attachComments(tree, providedComments, tokens) { + // At first, we should calculate extended comment ranges. + var comments = [], comment, len, i, cursor; + + if (!tree.range) { + throw new Error('attachComments needs range information'); + } + + // tokens array is empty, we attach comments to tree as 'leadingComments' + if (!tokens.length) { + if (providedComments.length) { + for (i = 0, len = providedComments.length; i < len; i += 1) { + comment = deepCopy(providedComments[i]); + comment.extendedRange = [0, tree.range[0]]; + comments.push(comment); + } + tree.leadingComments = comments; + } + return tree; + } + + for (i = 0, len = providedComments.length; i < len; i += 1) { + comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); + } + + // This is based on John Freeman's implementation. + cursor = 0; + traverse(tree, { + enter: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (comment.extendedRange[1] > node.range[0]) { + break; + } + + if (comment.extendedRange[1] === node.range[0]) { + if (!node.leadingComments) { + node.leadingComments = []; + } + node.leadingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + cursor = 0; + traverse(tree, { + leave: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (node.range[1] < comment.extendedRange[0]) { + break; + } + + if (node.range[1] === comment.extendedRange[0]) { + if (!node.trailingComments) { + node.trailingComments = []; + } + node.trailingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + return tree; + } + + exports.Syntax = Syntax; + exports.traverse = traverse; + exports.replace = replace; + exports.attachComments = attachComments; + exports.VisitorKeys = VisitorKeys; + exports.VisitorOption = VisitorOption; + exports.Controller = Controller; + exports.cloneEnvironment = function () { return clone({}); }; + + return exports; +}(exports)); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/package.json b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/package.json new file mode 100644 index 00000000000000..bc99e7c4a64674 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/node_modules/estraverse/package.json @@ -0,0 +1,40 @@ +{ + "name": "estraverse", + "description": "ECMAScript JS AST traversal functions", + "homepage": "https://github.com/estools/estraverse", + "main": "estraverse.js", + "version": "5.2.0", + "engines": { + "node": ">=4.0" + }, + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "web": "http://github.com/Constellation" + } + ], + "repository": { + "type": "git", + "url": "http://github.com/estools/estraverse.git" + }, + "devDependencies": { + "babel-preset-env": "^1.6.1", + "babel-register": "^6.3.13", + "chai": "^2.1.1", + "espree": "^1.11.0", + "gulp": "^3.8.10", + "gulp-bump": "^0.2.2", + "gulp-filter": "^2.0.0", + "gulp-git": "^1.0.1", + "gulp-tag-version": "^1.3.0", + "jshint": "^2.5.6", + "mocha": "^2.1.0" + }, + "license": "BSD-2-Clause", + "scripts": { + "test": "npm run-script lint && npm run-script unit-test", + "lint": "jshint estraverse.js", + "unit-test": "mocha --compilers js:babel-register" + } +} diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/package.json b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/package.json new file mode 100755 index 00000000000000..dec5b1bc1fd3ac --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/esrecurse/package.json @@ -0,0 +1,52 @@ +{ + "name": "esrecurse", + "description": "ECMAScript AST recursive visitor", + "homepage": "https://github.com/estools/esrecurse", + "main": "esrecurse.js", + "version": "4.3.0", + "engines": { + "node": ">=4.0" + }, + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "web": "https://github.com/Constellation" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/estools/esrecurse.git" + }, + "dependencies": { + "estraverse": "^5.2.0" + }, + "devDependencies": { + "babel-cli": "^6.24.1", + "babel-eslint": "^7.2.3", + "babel-preset-es2015": "^6.24.1", + "babel-register": "^6.24.1", + "chai": "^4.0.2", + "esprima": "^4.0.0", + "gulp": "^3.9.0", + "gulp-bump": "^2.7.0", + "gulp-eslint": "^4.0.0", + "gulp-filter": "^5.0.0", + "gulp-git": "^2.4.1", + "gulp-mocha": "^4.3.1", + "gulp-tag-version": "^1.2.1", + "jsdoc": "^3.3.0-alpha10", + "minimist": "^1.1.0" + }, + "license": "BSD-2-Clause", + "scripts": { + "test": "gulp travis", + "unit-test": "gulp test", + "lint": "gulp lint" + }, + "babel": { + "presets": [ + "es2015" + ] + } +} diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/LICENSE.BSD b/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/LICENSE.BSD new file mode 100644 index 00000000000000..3e580c355a96e5 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/LICENSE.BSD @@ -0,0 +1,19 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/README.md b/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/README.md new file mode 100644 index 00000000000000..ccd3377f3e9449 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/README.md @@ -0,0 +1,153 @@ +### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse) + +Estraverse ([estraverse](http://github.com/estools/estraverse)) is +[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +traversal functions from [esmangle project](http://github.com/estools/esmangle). + +### Documentation + +You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). + +### Example Usage + +The following code will output all variables declared at the root of a file. + +```javascript +estraverse.traverse(ast, { + enter: function (node, parent) { + if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') + return estraverse.VisitorOption.Skip; + }, + leave: function (node, parent) { + if (node.type == 'VariableDeclarator') + console.log(node.id.name); + } +}); +``` + +We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. + +```javascript +estraverse.traverse(ast, { + enter: function (node) { + this.break(); + } +}); +``` + +And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. + +```javascript +result = estraverse.replace(tree, { + enter: function (node) { + // Replace it with replaced. + if (node.type === 'Literal') + return replaced; + } +}); +``` + +By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Extending the existing traversing rules. + keys: { + // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] + TestExpression: ['argument'] + } +}); +``` + +By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Iterating the child **nodes** of unknown nodes. + fallback: 'iteration' +}); +``` + +When `visitor.fallback` is a function, we can determine which keys to visit on each node. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Skip the `argument` property of each node + fallback: function(node) { + return Object.keys(node).filter(function(key) { + return key !== 'argument'; + }); + } +}); +``` + +### License + +Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation) + (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/estraverse.js b/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/estraverse.js new file mode 100644 index 00000000000000..b106d386a6e1af --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/estraverse.js @@ -0,0 +1,782 @@ +/* + Copyright (C) 2012-2013 Yusuke Suzuki + Copyright (C) 2012 Ariya Hidayat + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/*jslint vars:false, bitwise:true*/ +/*jshint indent:4*/ +/*global exports:true*/ +(function clone(exports) { + 'use strict'; + + var Syntax, + VisitorOption, + VisitorKeys, + BREAK, + SKIP, + REMOVE; + + function deepCopy(obj) { + var ret = {}, key, val; + for (key in obj) { + if (obj.hasOwnProperty(key)) { + val = obj[key]; + if (typeof val === 'object' && val !== null) { + ret[key] = deepCopy(val); + } else { + ret[key] = val; + } + } + } + return ret; + } + + // based on LLVM libc++ upper_bound / lower_bound + // MIT License + + function upperBound(array, func) { + var diff, len, i, current; + + len = array.length; + i = 0; + + while (len) { + diff = len >>> 1; + current = i + diff; + if (func(array[current])) { + len = diff; + } else { + i = current + 1; + len -= diff + 1; + } + } + return i; + } + + Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. + ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DebuggerStatement: 'DebuggerStatement', + DirectiveStatement: 'DirectiveStatement', + DoWhileStatement: 'DoWhileStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + ForOfStatement: 'ForOfStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportExpression: 'ImportExpression', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + ModuleSpecifier: 'ModuleSpecifier', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + Program: 'Program', + Property: 'Property', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; + + VisitorKeys = { + AssignmentExpression: ['left', 'right'], + AssignmentPattern: ['left', 'right'], + ArrayExpression: ['elements'], + ArrayPattern: ['elements'], + ArrowFunctionExpression: ['params', 'body'], + AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. + BlockStatement: ['body'], + BinaryExpression: ['left', 'right'], + BreakStatement: ['label'], + CallExpression: ['callee', 'arguments'], + CatchClause: ['param', 'body'], + ClassBody: ['body'], + ClassDeclaration: ['id', 'superClass', 'body'], + ClassExpression: ['id', 'superClass', 'body'], + ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. + ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + ConditionalExpression: ['test', 'consequent', 'alternate'], + ContinueStatement: ['label'], + DebuggerStatement: [], + DirectiveStatement: [], + DoWhileStatement: ['body', 'test'], + EmptyStatement: [], + ExportAllDeclaration: ['source'], + ExportDefaultDeclaration: ['declaration'], + ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], + ExportSpecifier: ['exported', 'local'], + ExpressionStatement: ['expression'], + ForStatement: ['init', 'test', 'update', 'body'], + ForInStatement: ['left', 'right', 'body'], + ForOfStatement: ['left', 'right', 'body'], + FunctionDeclaration: ['id', 'params', 'body'], + FunctionExpression: ['id', 'params', 'body'], + GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + Identifier: [], + IfStatement: ['test', 'consequent', 'alternate'], + ImportExpression: ['source'], + ImportDeclaration: ['specifiers', 'source'], + ImportDefaultSpecifier: ['local'], + ImportNamespaceSpecifier: ['local'], + ImportSpecifier: ['imported', 'local'], + Literal: [], + LabeledStatement: ['label', 'body'], + LogicalExpression: ['left', 'right'], + MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], + MethodDefinition: ['key', 'value'], + ModuleSpecifier: [], + NewExpression: ['callee', 'arguments'], + ObjectExpression: ['properties'], + ObjectPattern: ['properties'], + Program: ['body'], + Property: ['key', 'value'], + RestElement: [ 'argument' ], + ReturnStatement: ['argument'], + SequenceExpression: ['expressions'], + SpreadElement: ['argument'], + Super: [], + SwitchStatement: ['discriminant', 'cases'], + SwitchCase: ['test', 'consequent'], + TaggedTemplateExpression: ['tag', 'quasi'], + TemplateElement: [], + TemplateLiteral: ['quasis', 'expressions'], + ThisExpression: [], + ThrowStatement: ['argument'], + TryStatement: ['block', 'handler', 'finalizer'], + UnaryExpression: ['argument'], + UpdateExpression: ['argument'], + VariableDeclaration: ['declarations'], + VariableDeclarator: ['id', 'init'], + WhileStatement: ['test', 'body'], + WithStatement: ['object', 'body'], + YieldExpression: ['argument'] + }; + + // unique id + BREAK = {}; + SKIP = {}; + REMOVE = {}; + + VisitorOption = { + Break: BREAK, + Skip: SKIP, + Remove: REMOVE + }; + + function Reference(parent, key) { + this.parent = parent; + this.key = key; + } + + Reference.prototype.replace = function replace(node) { + this.parent[this.key] = node; + }; + + Reference.prototype.remove = function remove() { + if (Array.isArray(this.parent)) { + this.parent.splice(this.key, 1); + return true; + } else { + this.replace(null); + return false; + } + }; + + function Element(node, path, wrap, ref) { + this.node = node; + this.path = path; + this.wrap = wrap; + this.ref = ref; + } + + function Controller() { } + + // API: + // return property path array from root to current node + Controller.prototype.path = function path() { + var i, iz, j, jz, result, element; + + function addToPath(result, path) { + if (Array.isArray(path)) { + for (j = 0, jz = path.length; j < jz; ++j) { + result.push(path[j]); + } + } else { + result.push(path); + } + } + + // root node + if (!this.__current.path) { + return null; + } + + // first node is sentinel, second node is root element + result = []; + for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { + element = this.__leavelist[i]; + addToPath(result, element.path); + } + addToPath(result, this.__current.path); + return result; + }; + + // API: + // return type of current node + Controller.prototype.type = function () { + var node = this.current(); + return node.type || this.__current.wrap; + }; + + // API: + // return array of parent elements + Controller.prototype.parents = function parents() { + var i, iz, result; + + // first node is sentinel + result = []; + for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { + result.push(this.__leavelist[i].node); + } + + return result; + }; + + // API: + // return current node + Controller.prototype.current = function current() { + return this.__current.node; + }; + + Controller.prototype.__execute = function __execute(callback, element) { + var previous, result; + + result = undefined; + + previous = this.__current; + this.__current = element; + this.__state = null; + if (callback) { + result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); + } + this.__current = previous; + + return result; + }; + + // API: + // notify control skip / break + Controller.prototype.notify = function notify(flag) { + this.__state = flag; + }; + + // API: + // skip child nodes of current node + Controller.prototype.skip = function () { + this.notify(SKIP); + }; + + // API: + // break traversals + Controller.prototype['break'] = function () { + this.notify(BREAK); + }; + + // API: + // remove node + Controller.prototype.remove = function () { + this.notify(REMOVE); + }; + + Controller.prototype.__initialize = function(root, visitor) { + this.visitor = visitor; + this.root = root; + this.__worklist = []; + this.__leavelist = []; + this.__current = null; + this.__state = null; + this.__fallback = null; + if (visitor.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof visitor.fallback === 'function') { + this.__fallback = visitor.fallback; + } + + this.__keys = VisitorKeys; + if (visitor.keys) { + this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); + } + }; + + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + + function isProperty(nodeType, key) { + return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; + } + + Controller.prototype.traverse = function traverse(root, visitor) { + var worklist, + leavelist, + element, + node, + nodeType, + ret, + key, + current, + current2, + candidates, + candidate, + sentinel; + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + worklist.push(new Element(root, null, null, null)); + leavelist.push(new Element(null, null, null, null)); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + ret = this.__execute(visitor.leave, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + continue; + } + + if (element.node) { + + ret = this.__execute(visitor.enter, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || ret === SKIP) { + continue; + } + + node = element.node; + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', null); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, null); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + worklist.push(new Element(candidate, key, null, null)); + } + } + } + } + }; + + Controller.prototype.replace = function replace(root, visitor) { + var worklist, + leavelist, + node, + nodeType, + target, + element, + current, + current2, + candidates, + candidate, + sentinel, + outer, + key; + + function removeElem(element) { + var i, + key, + nextElem, + parent; + + if (element.ref.remove()) { + // When the reference is an element of an array. + key = element.ref.key; + parent = element.ref.parent; + + // If removed from array, then decrease following items' keys. + i = worklist.length; + while (i--) { + nextElem = worklist[i]; + if (nextElem.ref && nextElem.ref.parent === parent) { + if (nextElem.ref.key < key) { + break; + } + --nextElem.ref.key; + } + } + } + } + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + outer = { + root: root + }; + element = new Element(root, null, null, new Reference(outer, 'root')); + worklist.push(element); + leavelist.push(element); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + target = this.__execute(visitor.leave, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + continue; + } + + target = this.__execute(visitor.enter, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + element.node = target; + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + element.node = null; + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + + // node may be null + node = element.node; + if (!node) { + continue; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || target === SKIP) { + continue; + } + + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + worklist.push(new Element(candidate, key, null, new Reference(node, key))); + } + } + } + + return outer.root; + }; + + function traverse(root, visitor) { + var controller = new Controller(); + return controller.traverse(root, visitor); + } + + function replace(root, visitor) { + var controller = new Controller(); + return controller.replace(root, visitor); + } + + function extendCommentRange(comment, tokens) { + var target; + + target = upperBound(tokens, function search(token) { + return token.range[0] > comment.range[0]; + }); + + comment.extendedRange = [comment.range[0], comment.range[1]]; + + if (target !== tokens.length) { + comment.extendedRange[1] = tokens[target].range[0]; + } + + target -= 1; + if (target >= 0) { + comment.extendedRange[0] = tokens[target].range[1]; + } + + return comment; + } + + function attachComments(tree, providedComments, tokens) { + // At first, we should calculate extended comment ranges. + var comments = [], comment, len, i, cursor; + + if (!tree.range) { + throw new Error('attachComments needs range information'); + } + + // tokens array is empty, we attach comments to tree as 'leadingComments' + if (!tokens.length) { + if (providedComments.length) { + for (i = 0, len = providedComments.length; i < len; i += 1) { + comment = deepCopy(providedComments[i]); + comment.extendedRange = [0, tree.range[0]]; + comments.push(comment); + } + tree.leadingComments = comments; + } + return tree; + } + + for (i = 0, len = providedComments.length; i < len; i += 1) { + comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); + } + + // This is based on John Freeman's implementation. + cursor = 0; + traverse(tree, { + enter: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (comment.extendedRange[1] > node.range[0]) { + break; + } + + if (comment.extendedRange[1] === node.range[0]) { + if (!node.leadingComments) { + node.leadingComments = []; + } + node.leadingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + cursor = 0; + traverse(tree, { + leave: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (node.range[1] < comment.extendedRange[0]) { + break; + } + + if (node.range[1] === comment.extendedRange[0]) { + if (!node.trailingComments) { + node.trailingComments = []; + } + node.trailingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + return tree; + } + + exports.version = require('./package.json').version; + exports.Syntax = Syntax; + exports.traverse = traverse; + exports.replace = replace; + exports.attachComments = attachComments; + exports.VisitorKeys = VisitorKeys; + exports.VisitorOption = VisitorOption; + exports.Controller = Controller; + exports.cloneEnvironment = function () { return clone({}); }; + + return exports; +}(exports)); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/package.json b/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/package.json new file mode 100644 index 00000000000000..1138238672309b --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/estraverse/package.json @@ -0,0 +1,40 @@ +{ + "name": "estraverse", + "description": "ECMAScript JS AST traversal functions", + "homepage": "https://github.com/estools/estraverse", + "main": "estraverse.js", + "version": "4.3.0", + "engines": { + "node": ">=4.0" + }, + "maintainers": [ + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "web": "http://github.com/Constellation" + } + ], + "repository": { + "type": "git", + "url": "http://github.com/estools/estraverse.git" + }, + "devDependencies": { + "babel-preset-env": "^1.6.1", + "babel-register": "^6.3.13", + "chai": "^2.1.1", + "espree": "^1.11.0", + "gulp": "^3.8.10", + "gulp-bump": "^0.2.2", + "gulp-filter": "^2.0.0", + "gulp-git": "^1.0.1", + "gulp-tag-version": "^1.3.0", + "jshint": "^2.5.6", + "mocha": "^2.1.0" + }, + "license": "BSD-2-Clause", + "scripts": { + "test": "npm run-script lint && npm run-script unit-test", + "lint": "jshint estraverse.js", + "unit-test": "mocha --compilers js:babel-register" + } +} diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/semver/LICENSE b/tools/node_modules/@babel/eslint-parser/node_modules/semver/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/semver/README.md b/tools/node_modules/@babel/eslint-parser/node_modules/semver/README.md new file mode 100644 index 00000000000000..2293a14fdc3579 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/semver/README.md @@ -0,0 +1,443 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero element in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions + are equal. Sorts in ascending order if passed to `Array.sort()`. + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the ranges comparators intersect + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version, options)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). + +If the `options.rtl` flag is set, then `coerce` will return the right-most +coercible tuple that does not share an ending index with a longer coercible +tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not +`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of +any other overlapping SemVer tuple. + +### Clean + +* `clean(version)`: Clean a string to be a valid semver if possible + +This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. + +ex. +* `s.clean(' = v 2.1.5foo')`: `null` +* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean(' = v 2.1.5-foo')`: `null` +* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean('=v2.1.5')`: `'2.1.5'` +* `s.clean(' =v2.1.5')`: `2.1.5` +* `s.clean(' 2.1.5 ')`: `'2.1.5'` +* `s.clean('~1.0.0')`: `null` diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/semver/bin/semver.js b/tools/node_modules/@babel/eslint-parser/node_modules/semver/bin/semver.js new file mode 100755 index 00000000000000..666034a75d8442 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/semver/bin/semver.js @@ -0,0 +1,174 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + +var versions = [] + +var range = [] + +var inc = null + +var version = require('../package.json').version + +var loose = false + +var includePrerelease = false + +var coerce = false + +var rtl = false + +var identifier + +var semver = require('../semver') + +var reverse = false + +var options = {} + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 1)) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-c': case '--coerce': + coerce = true + break + case '--rtl': + rtl = true + break + case '--ltr': + rtl = false + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } + + versions = versions.map(function (v) { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter(function (v) { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } + + for (var i = 0, l = range.length; i < l; i++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error('--inc can only be used on a single version with no range') + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? 'rcompare' : 'compare' + versions.sort(function (a, b) { + return semver[compare](a, b, options) + }).map(function (v) { + return semver.clean(v, options) + }).map(function (v) { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach(function (v, i, _) { console.log(v) }) +} + +function help () { + console.log(['SemVer ' + version, + '', + 'A JavaScript implementation of the https://semver.org/ specification', + 'Copyright Isaac Z. Schlueter', + '', + 'Usage: semver [options] [ [...]]', + 'Prints valid versions sorted by SemVer precedence', + '', + 'Options:', + '-r --range ', + ' Print versions that match the specified range.', + '', + '-i --increment []', + ' Increment a version by the specified level. Level can', + ' be one of: major, minor, patch, premajor, preminor,', + " prepatch, or prerelease. Default level is 'patch'.", + ' Only one version may be specified.', + '', + '--preid ', + ' Identifier to be used to prefix premajor, preminor,', + ' prepatch or prerelease version increments.', + '', + '-l --loose', + ' Interpret versions and ranges loosely', + '', + '-p --include-prerelease', + ' Always include prerelease versions in range matching', + '', + '-c --coerce', + ' Coerce a string into SemVer if possible', + ' (does not imply --loose)', + '', + '--rtl', + ' Coerce version strings right to left', + '', + '--ltr', + ' Coerce version strings left to right (default)', + '', + 'Program exits successfully if any valid version satisfies', + 'all supplied ranges, and prints all satisfying versions.', + '', + 'If no satisfying versions are found, then exits failure.', + '', + 'Versions are printed in ascending order, so supplying', + 'multiple versions to the utility will just sort them.' + ].join('\n')) +} diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/semver/package.json b/tools/node_modules/@babel/eslint-parser/node_modules/semver/package.json new file mode 100644 index 00000000000000..bdd442f50022f6 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/semver/package.json @@ -0,0 +1,28 @@ +{ + "name": "semver", + "version": "6.3.0", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "devDependencies": { + "tap": "^14.3.1" + }, + "license": "ISC", + "repository": "https://github.com/npm/node-semver", + "bin": { + "semver": "./bin/semver.js" + }, + "files": [ + "bin", + "range.bnf", + "semver.js" + ], + "tap": { + "check-coverage": true + } +} diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/semver/range.bnf b/tools/node_modules/@babel/eslint-parser/node_modules/semver/range.bnf new file mode 100644 index 00000000000000..d4c6ae0d76c9ac --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/semver/semver.js b/tools/node_modules/@babel/eslint-parser/node_modules/semver/semver.js new file mode 100644 index 00000000000000..636fa4365a175f --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/semver/semver.js @@ -0,0 +1,1596 @@ +exports = module.exports = SemVer + +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} +} + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' + +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 + +// The actual regexps go on exports.re +var re = exports.re = [] +var src = exports.src = [] +var t = exports.tokens = {} +var R = 0 + +function tok (n) { + t[n] = R++ +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +tok('NUMERICIDENTIFIER') +src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' +tok('NUMERICIDENTIFIERLOOSE') +src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +tok('NONNUMERICIDENTIFIER') +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' + +// ## Main Version +// Three dot-separated numeric identifiers. + +tok('MAINVERSION') +src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')' + +tok('MAINVERSIONLOOSE') +src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +tok('PRERELEASEIDENTIFIER') +src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' + +tok('PRERELEASEIDENTIFIERLOOSE') +src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +tok('PRERELEASE') +src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' + +tok('PRERELEASELOOSE') +src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +tok('BUILDIDENTIFIER') +src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +tok('BUILD') +src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +tok('FULL') +tok('FULLPLAIN') +src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + + src[t.PRERELEASE] + '?' + + src[t.BUILD] + '?' + +src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +tok('LOOSEPLAIN') +src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + + src[t.PRERELEASELOOSE] + '?' + + src[t.BUILD] + '?' + +tok('LOOSE') +src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' + +tok('GTLT') +src[t.GTLT] = '((?:<|>)?=?)' + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +tok('XRANGEIDENTIFIERLOOSE') +src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +tok('XRANGEIDENTIFIER') +src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' + +tok('XRANGEPLAIN') +src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:' + src[t.PRERELEASE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' + +tok('XRANGEPLAINLOOSE') +src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[t.PRERELEASELOOSE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' + +tok('XRANGE') +src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' +tok('XRANGELOOSE') +src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +tok('COERCE') +src[t.COERCE] = '(^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])' +tok('COERCERTL') +re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +tok('LONETILDE') +src[t.LONETILDE] = '(?:~>?)' + +tok('TILDETRIM') +src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' +re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') +var tildeTrimReplace = '$1~' + +tok('TILDE') +src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' +tok('TILDELOOSE') +src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +tok('LONECARET') +src[t.LONECARET] = '(?:\\^)' + +tok('CARETTRIM') +src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' +re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') +var caretTrimReplace = '$1^' + +tok('CARET') +src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' +tok('CARETLOOSE') +src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +tok('COMPARATORLOOSE') +src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' +tok('COMPARATOR') +src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +tok('COMPARATORTRIM') +src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' + +// this one has to use the /g flag +re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') +var comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +tok('HYPHENRANGE') +src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAIN] + ')' + + '\\s*$' + +tok('HYPHENRANGELOOSE') +src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s*$' + +// Star ranges basically just allow anything at all. +tok('STAR') +src[t.STAR] = '(<|>)?=?\\s*\\*' + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + } +} + +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + var r = options.loose ? re[t.LOOSE] : re[t.FULL] + if (!r.test(version)) { + return null + } + + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} + +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null +} + +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} + +exports.SemVer = SemVer + +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } + + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + + var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() +} + +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} + +SemVer.prototype.toString = function () { + return this.version +} + +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return this.compareMain(other) || this.comparePre(other) +} + +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +} + +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + var i = 0 + do { + var a = this.prerelease[i] + var b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +SemVer.prototype.compareBuild = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + var i = 0 + do { + var a = this.build[i] + var b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break + + default: + throw new Error('invalid increment argument: ' + release) + } + this.format() + this.raw = this.version + return this +} + +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } + + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} + +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre' + var defaultResult = 'prerelease' + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} + +exports.compareIdentifiers = compareIdentifiers + +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} + +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major +} + +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor +} + +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch +} + +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) +} + +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} + +exports.compareBuild = compareBuild +function compareBuild (a, b, loose) { + var versionA = new SemVer(a, loose) + var versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} + +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) +} + +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(a, b, loose) + }) +} + +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(b, a, loose) + }) +} + +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} + +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} + +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 +} + +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} + +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} + +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} + +exports.cmp = cmp +function cmp (a, op, b, loose) { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b + + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) + } +} + +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } + + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) +} + +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var m = comp.match(r) + + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } +} + +Comparator.prototype.toString = function () { + return this.value +} + +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) +} + +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + var rangeTmp + + if (this.operator === '') { + if (this.value === '') { + return true + } + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) + } + + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')) + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')) + + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +} + +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + return new Range(range.value, options) + } + + if (!(this instanceof Range)) { + return new Range(range, options) + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First, split based on boolean or || + this.raw = range + this.set = range.split(/\s*\|\|\s*/).map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range) + } + + this.format() +} + +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} + +Range.prototype.toString = function () { + return this.range +} + +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + range = range.trim() + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[t.COMPARATORTRIM]) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) + + // normalize spaces + range = range.split(/\s+/).join(' ') + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) + } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) + + return set +} + +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some(function (thisComparators) { + return ( + isSatisfiable(thisComparators, options) && + range.set.some(function (rangeComparators) { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every(function (thisComparator) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) +} + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +function isSatisfiable (comparators, options) { + var result = true + var remainingComparators = comparators.slice() + var testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every(function (otherComparator) { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator (comp, options) { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') +} + +function replaceTilde (comp, options) { + var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} + +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } + + debug('caret return', ret) + return ret + }) +} + +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} + +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + ret = gtlt + M + '.' + m + '.' + p + pr + } else if (xm) { + ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr + } else if (xp) { + ret = '>=' + M + '.' + m + '.0' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + pr + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[t.STAR], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } + + return (from + ' ' + to).trim() +} + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +} + +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} + +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} + +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} + +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) + + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} + +exports.validRange = validRange +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) +} + +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) + + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + var high = null + var low = null + + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} + +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} + +exports.coerce = coerce +function coerce (version, options) { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + var match = null + if (!options.rtl) { + match = version.match(re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + var next + while ((next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1 + } + + if (match === null) { + return null + } + + return parse(match[2] + + '.' + (match[3] || '0') + + '.' + (match[4] || '0'), options) +} diff --git a/tools/node_modules/@babel/eslint-parser/package.json b/tools/node_modules/@babel/eslint-parser/package.json new file mode 100644 index 00000000000000..115984fa1189f6 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/package.json @@ -0,0 +1,43 @@ +{ + "name": "@babel/eslint-parser", + "version": "7.12.1", + "description": "ESLint parser that allows for linting of experimental syntax transformed by Babel", + "author": "The Babel Team (https://babeljs.io/team)", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "eslint/babel-eslint-parser" + }, + "publishConfig": { + "access": "public" + }, + "bugs": { + "url": "https://github.com/babel/babel/issues" + }, + "homepage": "https://babeljs.io/", + "engines": { + "node": "^10.13.0 || ^12.13.0 || >=14.0.0" + }, + "main": "./lib/index.js", + "type": "commonjs", + "exports": { + ".": "./lib/index.js", + "./package.json": "./package.json" + }, + "peerDependencies": { + "@babel/core": ">=7.11.0", + "eslint": ">=7.5.0" + }, + "dependencies": { + "eslint-scope": "5.1.0", + "eslint-visitor-keys": "^1.3.0", + "semver": "^6.3.0" + }, + "devDependencies": { + "@babel/core": "^7.12.1", + "dedent": "^0.7.0", + "eslint": "^7.5.0", + "lodash.clonedeep": "^4.5.0" + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/plugin-syntax-class-properties/LICENSE b/tools/node_modules/@babel/plugin-syntax-class-properties/LICENSE new file mode 100644 index 00000000000000..f31575ec773bb1 --- /dev/null +++ b/tools/node_modules/@babel/plugin-syntax-class-properties/LICENSE @@ -0,0 +1,22 @@ +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/tools/node_modules/@babel/plugin-syntax-class-properties/README.md b/tools/node_modules/@babel/plugin-syntax-class-properties/README.md new file mode 100644 index 00000000000000..16ace370014e17 --- /dev/null +++ b/tools/node_modules/@babel/plugin-syntax-class-properties/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-syntax-class-properties + +> Allow parsing of class properties + +See our website [@babel/plugin-syntax-class-properties](https://babeljs.io/docs/en/next/babel-plugin-syntax-class-properties.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-syntax-class-properties +``` + +or using yarn: + +```sh +yarn add @babel/plugin-syntax-class-properties --dev +``` diff --git a/tools/node_modules/@babel/plugin-syntax-class-properties/lib/index.js b/tools/node_modules/@babel/plugin-syntax-class-properties/lib/index.js new file mode 100644 index 00000000000000..942008497a77bd --- /dev/null +++ b/tools/node_modules/@babel/plugin-syntax-class-properties/lib/index.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _helperPluginUtils = require("@babel/helper-plugin-utils"); + +var _default = (0, _helperPluginUtils.declare)(api => { + api.assertVersion(7); + return { + name: "syntax-class-properties", + + manipulateOptions(opts, parserOpts) { + parserOpts.plugins.push("classProperties", "classPrivateProperties", "classPrivateMethods"); + } + + }; +}); + +exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/LICENSE b/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/LICENSE new file mode 100644 index 00000000000000..f31575ec773bb1 --- /dev/null +++ b/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/LICENSE @@ -0,0 +1,22 @@ +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/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/README.md b/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/README.md new file mode 100644 index 00000000000000..4e6303e08962a2 --- /dev/null +++ b/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/README.md @@ -0,0 +1,19 @@ +# @babel/helper-plugin-utils + +> General utilities for plugins to use + +See our website [@babel/helper-plugin-utils](https://babeljs.io/docs/en/next/babel-helper-plugin-utils.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/helper-plugin-utils +``` + +or using yarn: + +```sh +yarn add @babel/helper-plugin-utils --dev +``` diff --git a/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/lib/index.js b/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/lib/index.js new file mode 100644 index 00000000000000..adb0656fa0e768 --- /dev/null +++ b/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/lib/index.js @@ -0,0 +1,77 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.declare = declare; + +function declare(builder) { + return (api, options, dirname) => { + if (!api.assertVersion) { + api = Object.assign(copyApiObject(api), { + assertVersion(range) { + throwVersionError(range, api.version); + } + + }); + } + + return builder(api, options || {}, dirname); + }; +} + +function copyApiObject(api) { + let proto = null; + + if (typeof api.version === "string" && /^7\./.test(api.version)) { + proto = Object.getPrototypeOf(api); + + if (proto && (!has(proto, "version") || !has(proto, "transform") || !has(proto, "template") || !has(proto, "types"))) { + proto = null; + } + } + + return Object.assign({}, proto, api); +} + +function has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +function throwVersionError(range, version) { + if (typeof range === "number") { + if (!Number.isInteger(range)) { + throw new Error("Expected string or integer value."); + } + + range = `^${range}.0.0-0`; + } + + if (typeof range !== "string") { + throw new Error("Expected string or integer value."); + } + + const limit = Error.stackTraceLimit; + + if (typeof limit === "number" && limit < 25) { + Error.stackTraceLimit = 25; + } + + let err; + + if (version.slice(0, 2) === "7.") { + err = new Error(`Requires Babel "^7.0.0-beta.41", but was loaded with "${version}". ` + `You'll need to update your @babel/core version.`); + } else { + err = new Error(`Requires Babel "${range}", but was loaded with "${version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`); + } + + if (typeof limit === "number") { + Error.stackTraceLimit = limit; + } + + throw Object.assign(err, { + code: "BABEL_VERSION_UNSUPPORTED", + version, + range + }); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/package.json b/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/package.json new file mode 100644 index 00000000000000..282d93f719fe54 --- /dev/null +++ b/tools/node_modules/@babel/plugin-syntax-class-properties/node_modules/@babel/helper-plugin-utils/package.json @@ -0,0 +1,18 @@ +{ + "name": "@babel/helper-plugin-utils", + "version": "7.10.4", + "description": "General utilities for plugins to use", + "author": "Logan Smyth ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-plugin-utils" + }, + "main": "lib/index.js", + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df" +} diff --git a/tools/node_modules/@babel/plugin-syntax-class-properties/package.json b/tools/node_modules/@babel/plugin-syntax-class-properties/package.json new file mode 100644 index 00000000000000..584a81d1514bf8 --- /dev/null +++ b/tools/node_modules/@babel/plugin-syntax-class-properties/package.json @@ -0,0 +1,27 @@ +{ + "name": "@babel/plugin-syntax-class-properties", + "version": "7.12.1", + "description": "Allow parsing of class properties", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-plugin-syntax-class-properties" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "keywords": [ + "babel-plugin" + ], + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + }, + "devDependencies": { + "@babel/core": "^7.12.1" + } +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/README.md b/tools/node_modules/babel-eslint/README.md deleted file mode 100644 index 6a4f9085e3ac5b..00000000000000 --- a/tools/node_modules/babel-eslint/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# babel-eslint [![npm](https://img.shields.io/npm/v/babel-eslint.svg)](https://www.npmjs.com/package/babel-eslint) [![travis](https://img.shields.io/travis/babel/babel-eslint/master.svg)](https://travis-ci.org/babel/babel-eslint) [![npm-downloads](https://img.shields.io/npm/dm/babel-eslint.svg)](https://www.npmjs.com/package/babel-eslint) - -**babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic -[ESLint](https://github.com/eslint/eslint). - -### Why Use babel-eslint - -You only need to use babel-eslint if you are using types (Flow) or experimental features not supported in ESLint itself yet. Otherwise try the default parser (you don't have to use it just because you are using Babel). - ---- - -> If there is an issue, first check if it can be reproduced with the regular parser or with the latest versions of `eslint` and `babel-eslint`! - -For questions and support please visit the [`#discussion`](https://babeljs.slack.com/messages/discussion/) babel slack channel (sign up [here](https://github.com/babel/notes/issues/38)) or eslint [gitter](https://gitter.im/eslint/eslint)! - -> Note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. Examples are `globalReturn` and `modules`). - -## Known Issues - -Flow: -> Check out [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype): An `eslint` plugin that makes flow type annotations global variables and marks declarations as used. Solves the problem of false positives with `no-undef` and `no-unused-vars`. -- `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076) - - Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'` -- `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) - -Modules/strict mode -- `no-unused-vars: [2, {vars: local}]` [#136](https://github.com/babel/babel-eslint/issues/136) - -Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for React/JSX issues -- `no-unused-vars` with jsx - -Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for other issues - -## How does it work? - -ESLint allows custom parsers. This is great but some of the syntax nodes that Babel supports -aren't supported by ESLint. When using this plugin, ESLint is monkeypatched and your code is -transformed into code that ESLint can understand. All location info such as line numbers, -columns is also retained so you can track down errors with ease. - -Basically `babel-eslint` exports an [`index.js`](/index.js) that a linter can use. -It just needs to export a `parse` method that takes in a string of code and outputs an AST. - -## Usage - -### Supported ESLint versions - -ESLint | babel-eslint ------------- | ------------- -4.x | >= 6.x -3.x | >= 6.x -2.x | >= 6.x -1.x | >= 5.x - -### Install - -Ensure that you have substituted the correct version lock for `eslint` and `babel-eslint` into this command: - -```sh -$ npm install eslint@4.x babel-eslint@8 --save-dev -# or -$ yarn add eslint@4.x babel-eslint@8 -D -``` - -### Setup - -**.eslintrc** - -```json -{ - "parser": "babel-eslint", - "rules": { - "strict": 0 - } -} -``` - -Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rules. - -### Configuration - -- `sourceType` can be set to `'module'`(default) or `'script'` if your code isn't using ECMAScript modules. -- `allowImportExportEverywhere` (default `false`) can be set to `true` to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. Otherwise import and export declarations can only appear at a program's top level. -- `codeFrame` (default `true`) can be set to `false` to disable the code frame in the reporter. This is useful since some eslint formatters don't play well with it. - -**.eslintrc** - -```json -{ - "parser": "babel-eslint", - "parserOptions": { - "sourceType": "module", - "allowImportExportEverywhere": false, - "codeFrame": true - } -} -``` - -### Run - -```sh -$ eslint your-files-here -``` diff --git a/tools/node_modules/babel-eslint/lib/babylon-to-espree/attachComments.js b/tools/node_modules/babel-eslint/lib/babylon-to-espree/attachComments.js deleted file mode 100644 index 8c608a45ad9473..00000000000000 --- a/tools/node_modules/babel-eslint/lib/babylon-to-espree/attachComments.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; - -// comment fixes -module.exports = function(ast, comments, tokens) { - if (comments.length) { - var firstComment = comments[0]; - var lastComment = comments[comments.length - 1]; - // fixup program start - if (!tokens.length) { - // if no tokens, the program starts at the end of the last comment - ast.start = lastComment.end; - ast.loc.start.line = lastComment.loc.end.line; - ast.loc.start.column = lastComment.loc.end.column; - - if (ast.leadingComments === null && ast.innerComments.length) { - ast.leadingComments = ast.innerComments; - } - } else if (firstComment.start < tokens[0].start) { - // if there are comments before the first token, the program starts at the first token - var token = tokens[0]; - // ast.start = token.start; - // ast.loc.start.line = token.loc.start.line; - // ast.loc.start.column = token.loc.start.column; - - // estraverse do not put leading comments on first node when the comment - // appear before the first token - if (ast.body.length) { - var node = ast.body[0]; - node.leadingComments = []; - var firstTokenStart = token.start; - var len = comments.length; - for (var i = 0; i < len && comments[i].start < firstTokenStart; i++) { - node.leadingComments.push(comments[i]); - } - } - } - // fixup program end - if (tokens.length) { - var lastToken = tokens[tokens.length - 1]; - if (lastComment.end > lastToken.end) { - // If there is a comment after the last token, the program ends at the - // last token and not the comment - // ast.end = lastToken.end; - ast.range[1] = lastToken.end; - ast.loc.end.line = lastToken.loc.end.line; - ast.loc.end.column = lastToken.loc.end.column; - } - } - } else { - if (!tokens.length) { - ast.loc.start.line = 1; - ast.loc.end.line = 1; - } - } - if (ast.body && ast.body.length > 0) { - ast.loc.start.line = ast.body[0].loc.start.line; - ast.range[0] = ast.body[0].start; - } -}; diff --git a/tools/node_modules/babel-eslint/lib/babylon-to-espree/convertTemplateType.js b/tools/node_modules/babel-eslint/lib/babylon-to-espree/convertTemplateType.js deleted file mode 100644 index accde61e56d6a9..00000000000000 --- a/tools/node_modules/babel-eslint/lib/babylon-to-espree/convertTemplateType.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; - -module.exports = function(tokens, tt) { - let curlyBrace = null; - let templateTokens = []; - const result = []; - - function addTemplateType() { - const start = templateTokens[0]; - const end = templateTokens[templateTokens.length - 1]; - - const value = templateTokens.reduce((result, token) => { - if (token.value) { - result += token.value; - } else if (token.type !== tt.template) { - result += token.type.label; - } - - return result; - }, ""); - - result.push({ - type: "Template", - value: value, - start: start.start, - end: end.end, - loc: { - start: start.loc.start, - end: end.loc.end, - }, - }); - - templateTokens = []; - } - - tokens.forEach(token => { - switch (token.type) { - case tt.backQuote: - if (curlyBrace) { - result.push(curlyBrace); - curlyBrace = null; - } - - templateTokens.push(token); - - if (templateTokens.length > 1) { - addTemplateType(); - } - - break; - - case tt.dollarBraceL: - templateTokens.push(token); - addTemplateType(); - break; - - case tt.braceR: - if (curlyBrace) { - result.push(curlyBrace); - } - - curlyBrace = token; - break; - - case tt.template: - if (curlyBrace) { - templateTokens.push(curlyBrace); - curlyBrace = null; - } - - templateTokens.push(token); - break; - - case tt.eof: - if (curlyBrace) { - result.push(curlyBrace); - } - - break; - - default: - if (curlyBrace) { - result.push(curlyBrace); - curlyBrace = null; - } - - result.push(token); - } - }); - - return result; -}; diff --git a/tools/node_modules/babel-eslint/lib/babylon-to-espree/index.js b/tools/node_modules/babel-eslint/lib/babylon-to-espree/index.js deleted file mode 100644 index 6d6e12bfc08686..00000000000000 --- a/tools/node_modules/babel-eslint/lib/babylon-to-espree/index.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; - -var attachComments = require("./attachComments"); -var convertComments = require("./convertComments"); -var toTokens = require("./toTokens"); -var toAST = require("./toAST"); - -module.exports = function(ast, traverse, tt, code) { - // convert tokens - ast.tokens = toTokens(ast.tokens, tt, code); - - // add comments - convertComments(ast.comments); - - // transform esprima and acorn divergent nodes - toAST(ast, traverse, code); - - // ast.program.tokens = ast.tokens; - // ast.program.comments = ast.comments; - // ast = ast.program; - - // remove File - ast.type = "Program"; - ast.sourceType = ast.program.sourceType; - ast.directives = ast.program.directives; - ast.body = ast.program.body; - delete ast.program; - - attachComments(ast, ast.comments, ast.tokens); -}; diff --git a/tools/node_modules/babel-eslint/lib/babylon-to-espree/toAST.js b/tools/node_modules/babel-eslint/lib/babylon-to-espree/toAST.js deleted file mode 100644 index b3da41f0cb0663..00000000000000 --- a/tools/node_modules/babel-eslint/lib/babylon-to-espree/toAST.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; - -var t = require("@babel/types"); -var convertComments = require("./convertComments"); - -module.exports = function(ast, traverse, code) { - var state = { source: code }; - - // Monkey patch visitor keys in order to be able to traverse the estree nodes - t.VISITOR_KEYS.Property = t.VISITOR_KEYS.ObjectProperty; - t.VISITOR_KEYS.MethodDefinition = [ - "key", - "value", - "decorators", - "returnType", - "typeParameters", - ]; - - traverse(ast, astTransformVisitor, null, state); - - delete t.VISITOR_KEYS.Property; - delete t.VISITOR_KEYS.MethodDefinition; -}; - -var astTransformVisitor = { - noScope: true, - enter(path) { - var node = path.node; - - // private var to track original node type - node._babelType = node.type; - - if (node.innerComments) { - node.trailingComments = node.innerComments; - delete node.innerComments; - } - - if (node.trailingComments) { - convertComments(node.trailingComments); - } - - if (node.leadingComments) { - convertComments(node.leadingComments); - } - }, - exit(path) { - var node = path.node; - - if (path.isJSXText()) { - node.type = "Literal"; - } - - if ( - path.isRestElement() && - path.parent && - path.parent.type === "ObjectPattern" - ) { - node.type = "ExperimentalRestProperty"; - } - - if ( - path.isSpreadElement() && - path.parent && - path.parent.type === "ObjectExpression" - ) { - node.type = "ExperimentalSpreadProperty"; - } - - if (path.isTypeParameter()) { - node.type = "Identifier"; - node.typeAnnotation = node.bound; - delete node.bound; - } - - // flow: prevent "no-undef" - // for "Component" in: "let x: React.Component" - if (path.isQualifiedTypeIdentifier()) { - delete node.id; - } - // for "b" in: "var a: { b: Foo }" - if (path.isObjectTypeProperty()) { - delete node.key; - } - // for "indexer" in: "var a: {[indexer: string]: number}" - if (path.isObjectTypeIndexer()) { - delete node.id; - } - // for "param" in: "var a: { func(param: Foo): Bar };" - if (path.isFunctionTypeParam()) { - delete node.name; - } - - // modules - - if (path.isImportDeclaration()) { - delete node.isType; - } - - // template string range fixes - if (path.isTemplateLiteral()) { - for (var j = 0; j < node.quasis.length; j++) { - var q = node.quasis[j]; - q.range[0] -= 1; - if (q.tail) { - q.range[1] += 1; - } else { - q.range[1] += 2; - } - q.loc.start.column -= 1; - if (q.tail) { - q.loc.end.column += 1; - } else { - q.loc.end.column += 2; - } - } - } - }, -}; diff --git a/tools/node_modules/babel-eslint/lib/babylon-to-espree/toToken.js b/tools/node_modules/babel-eslint/lib/babylon-to-espree/toToken.js deleted file mode 100644 index 44c73529a11159..00000000000000 --- a/tools/node_modules/babel-eslint/lib/babylon-to-espree/toToken.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; - -module.exports = function(token, tt, source) { - var type = token.type; - token.range = [token.start, token.end]; - - if (type === tt.name) { - token.type = "Identifier"; - } else if ( - type === tt.semi || - type === tt.comma || - type === tt.parenL || - type === tt.parenR || - type === tt.braceL || - type === tt.braceR || - type === tt.slash || - type === tt.dot || - type === tt.bracketL || - type === tt.bracketR || - type === tt.ellipsis || - type === tt.arrow || - type === tt.pipeline || - type === tt.star || - type === tt.incDec || - type === tt.colon || - type === tt.question || - type === tt.questionDot || - type === tt.template || - type === tt.backQuote || - type === tt.dollarBraceL || - type === tt.at || - type === tt.logicalOR || - type === tt.logicalAND || - type === tt.nullishCoalescing || - type === tt.bitwiseOR || - type === tt.bitwiseXOR || - type === tt.bitwiseAND || - type === tt.equality || - type === tt.relational || - type === tt.bitShift || - type === tt.plusMin || - type === tt.modulo || - type === tt.exponent || - type === tt.bang || - type === tt.tilde || - type === tt.doubleColon || - type.isAssign - ) { - token.type = "Punctuator"; - if (!token.value) token.value = type.label; - } else if (type === tt.jsxTagStart) { - token.type = "Punctuator"; - token.value = "<"; - } else if (type === tt.jsxTagEnd) { - token.type = "Punctuator"; - token.value = ">"; - } else if (type === tt.jsxName) { - token.type = "JSXIdentifier"; - } else if (type === tt.jsxText) { - token.type = "JSXText"; - } else if (type.keyword === "null") { - token.type = "Null"; - } else if (type.keyword === "false" || type.keyword === "true") { - token.type = "Boolean"; - } else if (type.keyword) { - token.type = "Keyword"; - } else if (type === tt.num) { - token.type = "Numeric"; - token.value = source.slice(token.start, token.end); - } else if (type === tt.string) { - token.type = "String"; - token.value = source.slice(token.start, token.end); - } else if (type === tt.regexp) { - token.type = "RegularExpression"; - var value = token.value; - token.regex = { - pattern: value.pattern, - flags: value.flags, - }; - token.value = `/${value.pattern}/${value.flags}`; - } - - return token; -}; diff --git a/tools/node_modules/babel-eslint/lib/babylon-to-espree/toTokens.js b/tools/node_modules/babel-eslint/lib/babylon-to-espree/toTokens.js deleted file mode 100644 index bb30819bacf717..00000000000000 --- a/tools/node_modules/babel-eslint/lib/babylon-to-espree/toTokens.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -var convertTemplateType = require("./convertTemplateType"); -var toToken = require("./toToken"); - -module.exports = function(tokens, tt, code) { - return convertTemplateType(tokens, tt) - .filter(t => t.type !== "CommentLine" && t.type !== "CommentBlock") - .map(t => toToken(t, tt, code)); -}; diff --git a/tools/node_modules/babel-eslint/lib/index.js b/tools/node_modules/babel-eslint/lib/index.js deleted file mode 100644 index 9e527d26d7f8ce..00000000000000 --- a/tools/node_modules/babel-eslint/lib/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -exports.parse = function(code, options) { - return exports.parseForESLint(code, options).ast; -}; - -exports.parseForESLint = function(code, options) { - options = options || {}; - options.ecmaVersion = options.ecmaVersion || 2018; - options.sourceType = options.sourceType || "module"; - options.allowImportExportEverywhere = - options.allowImportExportEverywhere || false; - - return require("./parse-with-scope")(code, options); -}; - -exports.parseNoPatch = function(code, options) { - return require("./parse")(code, options); -}; diff --git a/tools/node_modules/babel-eslint/lib/parse-with-scope.js b/tools/node_modules/babel-eslint/lib/parse-with-scope.js deleted file mode 100644 index 36e3fce5b06712..00000000000000 --- a/tools/node_modules/babel-eslint/lib/parse-with-scope.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -const visitorKeys = require("./visitor-keys"); -const analyzeScope = require("./analyze-scope"); -const parse = require("./parse"); - -module.exports = function(code, options) { - const ast = parse(code, options); - const scopeManager = analyzeScope(ast, options); - - return { ast, scopeManager, visitorKeys }; -}; diff --git a/tools/node_modules/babel-eslint/lib/parse.js b/tools/node_modules/babel-eslint/lib/parse.js deleted file mode 100644 index b23b9dc9fc75f0..00000000000000 --- a/tools/node_modules/babel-eslint/lib/parse.js +++ /dev/null @@ -1,93 +0,0 @@ -"use strict"; - -var babylonToEspree = require("./babylon-to-espree"); -var parse = require("@babel/parser").parse; -var tt = require("@babel/parser").tokTypes; -var traverse = require("@babel/traverse").default; -var codeFrameColumns = require("@babel/code-frame").codeFrameColumns; - -module.exports = function(code, options) { - const legacyDecorators = - options.ecmaFeatures && options.ecmaFeatures.legacyDecorators; - - var opts = { - codeFrame: options.hasOwnProperty("codeFrame") ? options.codeFrame : true, - sourceType: options.sourceType, - allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree - allowReturnOutsideFunction: true, - allowSuperOutsideMethod: true, - ranges: true, - tokens: true, - plugins: [ - ["flow", { all: true }], - "jsx", - "estree", - "asyncFunctions", - "asyncGenerators", - "classConstructorCall", - "classProperties", - legacyDecorators - ? "decorators-legacy" - : ["decorators", { decoratorsBeforeExport: false }], - "doExpressions", - "exponentiationOperator", - "exportDefaultFrom", - "exportNamespaceFrom", - "functionBind", - "functionSent", - "objectRestSpread", - "trailingFunctionCommas", - "dynamicImport", - "numericSeparator", - "optionalChaining", - "importMeta", - "classPrivateProperties", - "bigInt", - "optionalCatchBinding", - "throwExpressions", - ["pipelineOperator", { proposal: "minimal" }], - "nullishCoalescingOperator", - "logicalAssignment", - ], - }; - - var ast; - try { - ast = parse(code, opts); - } catch (err) { - if (err instanceof SyntaxError) { - err.lineNumber = err.loc.line; - err.column = err.loc.column; - - if (opts.codeFrame) { - err.lineNumber = err.loc.line; - err.column = err.loc.column + 1; - - // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start - err.message = - "Line " + - err.lineNumber + - ": " + - err.message.replace(/ \((\d+):(\d+)\)$/, "") + - // add codeframe - "\n\n" + - codeFrameColumns( - code, - { - start: { - line: err.lineNumber, - column: err.column, - }, - }, - { highlightCode: true } - ); - } - } - - throw err; - } - - babylonToEspree(ast, traverse, tt, code); - - return ast; -}; diff --git a/tools/node_modules/babel-eslint/lib/require-from-eslint.js b/tools/node_modules/babel-eslint/lib/require-from-eslint.js deleted file mode 100644 index 3834689f54bde4..00000000000000 --- a/tools/node_modules/babel-eslint/lib/require-from-eslint.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; - -const resolve = require("resolve"); -const eslintBase = require.resolve("eslint"); - -module.exports = function requireFromESLint(id) { - const path = resolve.sync(id, { basedir: eslintBase }); - return require(path); -}; diff --git a/tools/node_modules/babel-eslint/lib/visitor-keys.js b/tools/node_modules/babel-eslint/lib/visitor-keys.js deleted file mode 100644 index 921a0bb0165749..00000000000000 --- a/tools/node_modules/babel-eslint/lib/visitor-keys.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -const BABEL_VISITOR_KEYS = require("@babel/types").VISITOR_KEYS; -const ESLINT_VISITOR_KEYS = require("eslint-visitor-keys").KEYS; - -module.exports = Object.assign( - { - Literal: ESLINT_VISITOR_KEYS.Literal, - MethodDefinition: ["decorators"].concat( - ESLINT_VISITOR_KEYS.MethodDefinition - ), - Property: ["decorators"].concat(ESLINT_VISITOR_KEYS.Property), - }, - BABEL_VISITOR_KEYS -); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/README.md b/tools/node_modules/babel-eslint/node_modules/@babel/generator/README.md deleted file mode 100644 index fc980b167d1513..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/generator - -> Turns an AST into code. - -See our website [@babel/generator](https://babeljs.io/docs/en/next/babel-generator.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/generator -``` - -or using yarn: - -```sh -yarn add @babel/generator --dev -``` diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/node/parentheses.js b/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/node/parentheses.js deleted file mode 100644 index 3f98dc18f8e3ab..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/lib/node/parentheses.js +++ /dev/null @@ -1,253 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NullableTypeAnnotation = NullableTypeAnnotation; -exports.FunctionTypeAnnotation = FunctionTypeAnnotation; -exports.UpdateExpression = UpdateExpression; -exports.ObjectExpression = ObjectExpression; -exports.DoExpression = DoExpression; -exports.Binary = Binary; -exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation; -exports.TSAsExpression = TSAsExpression; -exports.TSTypeAssertion = TSTypeAssertion; -exports.TSIntersectionType = exports.TSUnionType = TSUnionType; -exports.BinaryExpression = BinaryExpression; -exports.SequenceExpression = SequenceExpression; -exports.AwaitExpression = exports.YieldExpression = YieldExpression; -exports.ClassExpression = ClassExpression; -exports.UnaryLike = UnaryLike; -exports.FunctionExpression = FunctionExpression; -exports.ArrowFunctionExpression = ArrowFunctionExpression; -exports.ConditionalExpression = ConditionalExpression; -exports.OptionalMemberExpression = OptionalMemberExpression; -exports.AssignmentExpression = AssignmentExpression; -exports.NewExpression = NewExpression; - -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const PRECEDENCE = { - "||": 0, - "&&": 1, - "|": 2, - "^": 3, - "&": 4, - "==": 5, - "===": 5, - "!=": 5, - "!==": 5, - "<": 6, - ">": 6, - "<=": 6, - ">=": 6, - in: 6, - instanceof: 6, - ">>": 7, - "<<": 7, - ">>>": 7, - "+": 8, - "-": 8, - "*": 9, - "/": 9, - "%": 9, - "**": 10 -}; - -const isClassExtendsClause = (node, parent) => (t().isClassDeclaration(parent) || t().isClassExpression(parent)) && parent.superClass === node; - -function NullableTypeAnnotation(node, parent) { - return t().isArrayTypeAnnotation(parent); -} - -function FunctionTypeAnnotation(node, parent) { - return t().isUnionTypeAnnotation(parent) || t().isIntersectionTypeAnnotation(parent) || t().isArrayTypeAnnotation(parent); -} - -function UpdateExpression(node, parent) { - return t().isMemberExpression(parent, { - object: node - }) || t().isCallExpression(parent, { - callee: node - }) || t().isNewExpression(parent, { - callee: node - }) || isClassExtendsClause(node, parent); -} - -function ObjectExpression(node, parent, printStack) { - return isFirstInStatement(printStack, { - considerArrow: true - }); -} - -function DoExpression(node, parent, printStack) { - return isFirstInStatement(printStack); -} - -function Binary(node, parent) { - if (node.operator === "**" && t().isBinaryExpression(parent, { - operator: "**" - })) { - return parent.left === node; - } - - if (isClassExtendsClause(node, parent)) { - return true; - } - - if ((t().isCallExpression(parent) || t().isNewExpression(parent)) && parent.callee === node || t().isUnaryLike(parent) || t().isMemberExpression(parent) && parent.object === node || t().isAwaitExpression(parent)) { - return true; - } - - if (t().isBinary(parent)) { - const parentOp = parent.operator; - const parentPos = PRECEDENCE[parentOp]; - const nodeOp = node.operator; - const nodePos = PRECEDENCE[nodeOp]; - - if (parentPos === nodePos && parent.right === node && !t().isLogicalExpression(parent) || parentPos > nodePos) { - return true; - } - } - - return false; -} - -function UnionTypeAnnotation(node, parent) { - return t().isArrayTypeAnnotation(parent) || t().isNullableTypeAnnotation(parent) || t().isIntersectionTypeAnnotation(parent) || t().isUnionTypeAnnotation(parent); -} - -function TSAsExpression() { - return true; -} - -function TSTypeAssertion() { - return true; -} - -function TSUnionType(node, parent) { - return t().isTSArrayType(parent) || t().isTSOptionalType(parent) || t().isTSIntersectionType(parent) || t().isTSUnionType(parent) || t().isTSRestType(parent); -} - -function BinaryExpression(node, parent) { - return node.operator === "in" && (t().isVariableDeclarator(parent) || t().isFor(parent)); -} - -function SequenceExpression(node, parent) { - if (t().isForStatement(parent) || t().isThrowStatement(parent) || t().isReturnStatement(parent) || t().isIfStatement(parent) && parent.test === node || t().isWhileStatement(parent) && parent.test === node || t().isForInStatement(parent) && parent.right === node || t().isSwitchStatement(parent) && parent.discriminant === node || t().isExpressionStatement(parent) && parent.expression === node) { - return false; - } - - return true; -} - -function YieldExpression(node, parent) { - return t().isBinary(parent) || t().isUnaryLike(parent) || t().isCallExpression(parent) || t().isMemberExpression(parent) || t().isNewExpression(parent) || t().isAwaitExpression(parent) && t().isYieldExpression(node) || t().isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent); -} - -function ClassExpression(node, parent, printStack) { - return isFirstInStatement(printStack, { - considerDefaultExports: true - }); -} - -function UnaryLike(node, parent) { - return t().isMemberExpression(parent, { - object: node - }) || t().isCallExpression(parent, { - callee: node - }) || t().isNewExpression(parent, { - callee: node - }) || t().isBinaryExpression(parent, { - operator: "**", - left: node - }) || isClassExtendsClause(node, parent); -} - -function FunctionExpression(node, parent, printStack) { - return isFirstInStatement(printStack, { - considerDefaultExports: true - }); -} - -function ArrowFunctionExpression(node, parent) { - return t().isExportDeclaration(parent) || ConditionalExpression(node, parent); -} - -function ConditionalExpression(node, parent) { - if (t().isUnaryLike(parent) || t().isBinary(parent) || t().isConditionalExpression(parent, { - test: node - }) || t().isAwaitExpression(parent) || t().isOptionalMemberExpression(parent) || t().isTaggedTemplateExpression(parent) || t().isTSTypeAssertion(parent) || t().isTSAsExpression(parent)) { - return true; - } - - return UnaryLike(node, parent); -} - -function OptionalMemberExpression(node, parent) { - return t().isCallExpression(parent) || t().isMemberExpression(parent); -} - -function AssignmentExpression(node) { - if (t().isObjectPattern(node.left)) { - return true; - } else { - return ConditionalExpression(...arguments); - } -} - -function NewExpression(node, parent) { - return isClassExtendsClause(node, parent); -} - -function isFirstInStatement(printStack, { - considerArrow = false, - considerDefaultExports = false -} = {}) { - let i = printStack.length - 1; - let node = printStack[i]; - i--; - let parent = printStack[i]; - - while (i > 0) { - if (t().isExpressionStatement(parent, { - expression: node - }) || t().isTaggedTemplateExpression(parent) || considerDefaultExports && t().isExportDefaultDeclaration(parent, { - declaration: node - }) || considerArrow && t().isArrowFunctionExpression(parent, { - body: node - })) { - return true; - } - - if (t().isCallExpression(parent, { - callee: node - }) || t().isSequenceExpression(parent) && parent.expressions[0] === node || t().isMemberExpression(parent, { - object: node - }) || t().isConditional(parent, { - test: node - }) || t().isBinary(parent, { - left: node - }) || t().isAssignmentExpression(parent, { - left: node - })) { - node = parent; - i--; - parent = printStack[i]; - } else { - return false; - } - } - - return false; -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/generator/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/generator/package.json deleted file mode 100644 index 6eca8973ea377b..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/generator/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bundleDependencies": false, - "dependencies": { - "@babel/types": "^7.5.5", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - }, - "deprecated": false, - "description": "Turns an AST into code.", - "devDependencies": { - "@babel/helper-fixtures": "^7.5.5", - "@babel/parser": "^7.5.5" - }, - "files": [ - "lib" - ], - "gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43", - "homepage": "https://babeljs.io/", - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/generator", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/babel-generator" - }, - "version": "7.5.5" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/package.json deleted file mode 100644 index dfed420aaecb16..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/helper-function-name/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "bundleDependencies": false, - "dependencies": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" - }, - "deprecated": false, - "description": "Helper function to change the property 'name' of every function", - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-function-name", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/babel-helper-function-name" - }, - "version": "7.1.0" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/lib/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/lib/index.js deleted file mode 100644 index 5723401db71236..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/lib/index.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _default; - -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _default(node) { - const params = node.params; - - for (let i = 0; i < params.length; i++) { - const param = params[i]; - - if (t().isAssignmentPattern(param) || t().isRestElement(param)) { - return i; - } - } - - return params.length; -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/package.json deleted file mode 100644 index 49d2e854daecb8..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "bundleDependencies": false, - "dependencies": { - "@babel/types": "^7.0.0" - }, - "deprecated": false, - "description": "Helper function to get function arity", - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-get-function-arity", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/babel-helper-get-function-arity" - }, - "version": "7.0.0" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-split-export-declaration/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/helper-split-export-declaration/package.json deleted file mode 100644 index 8f3e0fdbd78168..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/helper-split-export-declaration/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "bundleDependencies": false, - "dependencies": { - "@babel/types": "^7.4.4" - }, - "deprecated": false, - "description": ">", - "gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba", - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-split-export-declaration", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration" - }, - "version": "7.4.4" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/parser/README.md b/tools/node_modules/babel-eslint/node_modules/@babel/parser/README.md deleted file mode 100644 index 65092a05347ea1..00000000000000 --- a/tools/node_modules/babel-eslint/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/next/babel-parser.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%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/tools/node_modules/babel-eslint/node_modules/@babel/template/README.md b/tools/node_modules/babel-eslint/node_modules/@babel/template/README.md deleted file mode 100644 index cf8f944396f8ba..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/template/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/template - -> Generate an AST from a string template. - -See our website [@babel/template](https://babeljs.io/docs/en/next/babel-template.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20template%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/template -``` - -or using yarn: - -```sh -yarn add @babel/template --dev -``` diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/template/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/template/package.json deleted file mode 100644 index 54bdfd6423342b..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/template/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bundleDependencies": false, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.4", - "@babel/types": "^7.4.4" - }, - "deprecated": false, - "description": "Generate an AST from a string template.", - "gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba", - "homepage": "https://babeljs.io/", - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/template", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/babel-template" - }, - "version": "7.4.4" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/comments.js b/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/comments.js deleted file mode 100644 index 09ec514b91a2a4..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/comments.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.shareCommentsWithSiblings = shareCommentsWithSiblings; -exports.addComment = addComment; -exports.addComments = addComments; - -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function shareCommentsWithSiblings() { - if (typeof this.key === "string") return; - const node = this.node; - if (!node) return; - const trailing = node.trailingComments; - const leading = node.leadingComments; - if (!trailing && !leading) return; - const prev = this.getSibling(this.key - 1); - const next = this.getSibling(this.key + 1); - const hasPrev = Boolean(prev.node); - const hasNext = Boolean(next.node); - - if (hasPrev && hasNext) {} else if (hasPrev) { - prev.addComments("trailing", trailing); - } else if (hasNext) { - next.addComments("leading", leading); - } -} - -function addComment(type, content, line) { - t().addComment(this.node, type, content, line); -} - -function addComments(type, comments) { - t().addComments(this.node, type, comments); -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/inference/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/inference/index.js deleted file mode 100644 index 80a77d08ae691c..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/lib/path/inference/index.js +++ /dev/null @@ -1,132 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getTypeAnnotation = getTypeAnnotation; -exports._getTypeAnnotation = _getTypeAnnotation; -exports.isBaseType = isBaseType; -exports.couldBeBaseType = couldBeBaseType; -exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches; -exports.isGenericType = isGenericType; - -var inferers = _interopRequireWildcard(require("./inferers")); - -function t() { - const data = _interopRequireWildcard(require("@babel/types")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function getTypeAnnotation() { - if (this.typeAnnotation) return this.typeAnnotation; - let type = this._getTypeAnnotation() || t().anyTypeAnnotation(); - if (t().isTypeAnnotation(type)) type = type.typeAnnotation; - return this.typeAnnotation = type; -} - -function _getTypeAnnotation() { - const node = this.node; - - if (!node) { - if (this.key === "init" && this.parentPath.isVariableDeclarator()) { - const declar = this.parentPath.parentPath; - const declarParent = declar.parentPath; - - if (declar.key === "left" && declarParent.isForInStatement()) { - return t().stringTypeAnnotation(); - } - - if (declar.key === "left" && declarParent.isForOfStatement()) { - return t().anyTypeAnnotation(); - } - - return t().voidTypeAnnotation(); - } else { - return; - } - } - - if (node.typeAnnotation) { - return node.typeAnnotation; - } - - let inferer = inferers[node.type]; - - if (inferer) { - return inferer.call(this, node); - } - - inferer = inferers[this.parentPath.type]; - - if (inferer && inferer.validParent) { - return this.parentPath.getTypeAnnotation(); - } -} - -function isBaseType(baseName, soft) { - return _isBaseType(baseName, this.getTypeAnnotation(), soft); -} - -function _isBaseType(baseName, type, soft) { - if (baseName === "string") { - return t().isStringTypeAnnotation(type); - } else if (baseName === "number") { - return t().isNumberTypeAnnotation(type); - } else if (baseName === "boolean") { - return t().isBooleanTypeAnnotation(type); - } else if (baseName === "any") { - return t().isAnyTypeAnnotation(type); - } else if (baseName === "mixed") { - return t().isMixedTypeAnnotation(type); - } else if (baseName === "empty") { - return t().isEmptyTypeAnnotation(type); - } else if (baseName === "void") { - return t().isVoidTypeAnnotation(type); - } else { - if (soft) { - return false; - } else { - throw new Error(`Unknown base type ${baseName}`); - } - } -} - -function couldBeBaseType(name) { - const type = this.getTypeAnnotation(); - if (t().isAnyTypeAnnotation(type)) return true; - - if (t().isUnionTypeAnnotation(type)) { - for (const type2 of type.types) { - if (t().isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) { - return true; - } - } - - return false; - } else { - return _isBaseType(name, type, true); - } -} - -function baseTypeStrictlyMatches(right) { - const left = this.getTypeAnnotation(); - right = right.getTypeAnnotation(); - - if (!t().isAnyTypeAnnotation(left) && t().isFlowBaseAnnotation(left)) { - return right.type === left.type; - } -} - -function isGenericType(genericName) { - const type = this.getTypeAnnotation(); - return t().isGenericTypeAnnotation(type) && t().isIdentifier(type.id, { - name: genericName - }); -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/traverse/package.json deleted file mode 100644 index f53af95bf56a7c..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/traverse/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bundleDependencies": false, - "dependencies": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.5.5", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.5.5", - "@babel/types": "^7.5.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - }, - "deprecated": false, - "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", - "devDependencies": { - "@babel/helper-plugin-test-runner": "^7.0.0" - }, - "gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43", - "homepage": "https://babeljs.io/", - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/traverse", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/babel-traverse" - }, - "version": "7.5.5" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/README.md b/tools/node_modules/babel-eslint/node_modules/@babel/types/README.md deleted file mode 100644 index 8d33374d3ba416..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/types - -> Babel Types is a Lodash-esque utility library for AST nodes - -See our website [@babel/types](https://babeljs.io/docs/en/next/babel-types.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/types -``` - -or using yarn: - -```sh -yarn add @babel/types --dev -``` diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/generated/index.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/generated/index.js deleted file mode 100644 index 06d0127d12981b..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/builders/generated/index.js +++ /dev/null @@ -1,1148 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.arrayExpression = exports.ArrayExpression = ArrayExpression; -exports.assignmentExpression = exports.AssignmentExpression = AssignmentExpression; -exports.binaryExpression = exports.BinaryExpression = BinaryExpression; -exports.interpreterDirective = exports.InterpreterDirective = InterpreterDirective; -exports.directive = exports.Directive = Directive; -exports.directiveLiteral = exports.DirectiveLiteral = DirectiveLiteral; -exports.blockStatement = exports.BlockStatement = BlockStatement; -exports.breakStatement = exports.BreakStatement = BreakStatement; -exports.callExpression = exports.CallExpression = CallExpression; -exports.catchClause = exports.CatchClause = CatchClause; -exports.conditionalExpression = exports.ConditionalExpression = ConditionalExpression; -exports.continueStatement = exports.ContinueStatement = ContinueStatement; -exports.debuggerStatement = exports.DebuggerStatement = DebuggerStatement; -exports.doWhileStatement = exports.DoWhileStatement = DoWhileStatement; -exports.emptyStatement = exports.EmptyStatement = EmptyStatement; -exports.expressionStatement = exports.ExpressionStatement = ExpressionStatement; -exports.file = exports.File = File; -exports.forInStatement = exports.ForInStatement = ForInStatement; -exports.forStatement = exports.ForStatement = ForStatement; -exports.functionDeclaration = exports.FunctionDeclaration = FunctionDeclaration; -exports.functionExpression = exports.FunctionExpression = FunctionExpression; -exports.identifier = exports.Identifier = Identifier; -exports.ifStatement = exports.IfStatement = IfStatement; -exports.labeledStatement = exports.LabeledStatement = LabeledStatement; -exports.stringLiteral = exports.StringLiteral = StringLiteral; -exports.numericLiteral = exports.NumericLiteral = NumericLiteral; -exports.nullLiteral = exports.NullLiteral = NullLiteral; -exports.booleanLiteral = exports.BooleanLiteral = BooleanLiteral; -exports.regExpLiteral = exports.RegExpLiteral = RegExpLiteral; -exports.logicalExpression = exports.LogicalExpression = LogicalExpression; -exports.memberExpression = exports.MemberExpression = MemberExpression; -exports.newExpression = exports.NewExpression = NewExpression; -exports.program = exports.Program = Program; -exports.objectExpression = exports.ObjectExpression = ObjectExpression; -exports.objectMethod = exports.ObjectMethod = ObjectMethod; -exports.objectProperty = exports.ObjectProperty = ObjectProperty; -exports.restElement = exports.RestElement = RestElement; -exports.returnStatement = exports.ReturnStatement = ReturnStatement; -exports.sequenceExpression = exports.SequenceExpression = SequenceExpression; -exports.parenthesizedExpression = exports.ParenthesizedExpression = ParenthesizedExpression; -exports.switchCase = exports.SwitchCase = SwitchCase; -exports.switchStatement = exports.SwitchStatement = SwitchStatement; -exports.thisExpression = exports.ThisExpression = ThisExpression; -exports.throwStatement = exports.ThrowStatement = ThrowStatement; -exports.tryStatement = exports.TryStatement = TryStatement; -exports.unaryExpression = exports.UnaryExpression = UnaryExpression; -exports.updateExpression = exports.UpdateExpression = UpdateExpression; -exports.variableDeclaration = exports.VariableDeclaration = VariableDeclaration; -exports.variableDeclarator = exports.VariableDeclarator = VariableDeclarator; -exports.whileStatement = exports.WhileStatement = WhileStatement; -exports.withStatement = exports.WithStatement = WithStatement; -exports.assignmentPattern = exports.AssignmentPattern = AssignmentPattern; -exports.arrayPattern = exports.ArrayPattern = ArrayPattern; -exports.arrowFunctionExpression = exports.ArrowFunctionExpression = ArrowFunctionExpression; -exports.classBody = exports.ClassBody = ClassBody; -exports.classDeclaration = exports.ClassDeclaration = ClassDeclaration; -exports.classExpression = exports.ClassExpression = ClassExpression; -exports.exportAllDeclaration = exports.ExportAllDeclaration = ExportAllDeclaration; -exports.exportDefaultDeclaration = exports.ExportDefaultDeclaration = ExportDefaultDeclaration; -exports.exportNamedDeclaration = exports.ExportNamedDeclaration = ExportNamedDeclaration; -exports.exportSpecifier = exports.ExportSpecifier = ExportSpecifier; -exports.forOfStatement = exports.ForOfStatement = ForOfStatement; -exports.importDeclaration = exports.ImportDeclaration = ImportDeclaration; -exports.importDefaultSpecifier = exports.ImportDefaultSpecifier = ImportDefaultSpecifier; -exports.importNamespaceSpecifier = exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; -exports.importSpecifier = exports.ImportSpecifier = ImportSpecifier; -exports.metaProperty = exports.MetaProperty = MetaProperty; -exports.classMethod = exports.ClassMethod = ClassMethod; -exports.objectPattern = exports.ObjectPattern = ObjectPattern; -exports.spreadElement = exports.SpreadElement = SpreadElement; -exports.super = exports.Super = Super; -exports.taggedTemplateExpression = exports.TaggedTemplateExpression = TaggedTemplateExpression; -exports.templateElement = exports.TemplateElement = TemplateElement; -exports.templateLiteral = exports.TemplateLiteral = TemplateLiteral; -exports.yieldExpression = exports.YieldExpression = YieldExpression; -exports.anyTypeAnnotation = exports.AnyTypeAnnotation = AnyTypeAnnotation; -exports.arrayTypeAnnotation = exports.ArrayTypeAnnotation = ArrayTypeAnnotation; -exports.booleanTypeAnnotation = exports.BooleanTypeAnnotation = BooleanTypeAnnotation; -exports.booleanLiteralTypeAnnotation = exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation; -exports.nullLiteralTypeAnnotation = exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation; -exports.classImplements = exports.ClassImplements = ClassImplements; -exports.declareClass = exports.DeclareClass = DeclareClass; -exports.declareFunction = exports.DeclareFunction = DeclareFunction; -exports.declareInterface = exports.DeclareInterface = DeclareInterface; -exports.declareModule = exports.DeclareModule = DeclareModule; -exports.declareModuleExports = exports.DeclareModuleExports = DeclareModuleExports; -exports.declareTypeAlias = exports.DeclareTypeAlias = DeclareTypeAlias; -exports.declareOpaqueType = exports.DeclareOpaqueType = DeclareOpaqueType; -exports.declareVariable = exports.DeclareVariable = DeclareVariable; -exports.declareExportDeclaration = exports.DeclareExportDeclaration = DeclareExportDeclaration; -exports.declareExportAllDeclaration = exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration; -exports.declaredPredicate = exports.DeclaredPredicate = DeclaredPredicate; -exports.existsTypeAnnotation = exports.ExistsTypeAnnotation = ExistsTypeAnnotation; -exports.functionTypeAnnotation = exports.FunctionTypeAnnotation = FunctionTypeAnnotation; -exports.functionTypeParam = exports.FunctionTypeParam = FunctionTypeParam; -exports.genericTypeAnnotation = exports.GenericTypeAnnotation = GenericTypeAnnotation; -exports.inferredPredicate = exports.InferredPredicate = InferredPredicate; -exports.interfaceExtends = exports.InterfaceExtends = InterfaceExtends; -exports.interfaceDeclaration = exports.InterfaceDeclaration = InterfaceDeclaration; -exports.interfaceTypeAnnotation = exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation; -exports.intersectionTypeAnnotation = exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation; -exports.mixedTypeAnnotation = exports.MixedTypeAnnotation = MixedTypeAnnotation; -exports.emptyTypeAnnotation = exports.EmptyTypeAnnotation = EmptyTypeAnnotation; -exports.nullableTypeAnnotation = exports.NullableTypeAnnotation = NullableTypeAnnotation; -exports.numberLiteralTypeAnnotation = exports.NumberLiteralTypeAnnotation = NumberLiteralTypeAnnotation; -exports.numberTypeAnnotation = exports.NumberTypeAnnotation = NumberTypeAnnotation; -exports.objectTypeAnnotation = exports.ObjectTypeAnnotation = ObjectTypeAnnotation; -exports.objectTypeInternalSlot = exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot; -exports.objectTypeCallProperty = exports.ObjectTypeCallProperty = ObjectTypeCallProperty; -exports.objectTypeIndexer = exports.ObjectTypeIndexer = ObjectTypeIndexer; -exports.objectTypeProperty = exports.ObjectTypeProperty = ObjectTypeProperty; -exports.objectTypeSpreadProperty = exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty; -exports.opaqueType = exports.OpaqueType = OpaqueType; -exports.qualifiedTypeIdentifier = exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier; -exports.stringLiteralTypeAnnotation = exports.StringLiteralTypeAnnotation = StringLiteralTypeAnnotation; -exports.stringTypeAnnotation = exports.StringTypeAnnotation = StringTypeAnnotation; -exports.thisTypeAnnotation = exports.ThisTypeAnnotation = ThisTypeAnnotation; -exports.tupleTypeAnnotation = exports.TupleTypeAnnotation = TupleTypeAnnotation; -exports.typeofTypeAnnotation = exports.TypeofTypeAnnotation = TypeofTypeAnnotation; -exports.typeAlias = exports.TypeAlias = TypeAlias; -exports.typeAnnotation = exports.TypeAnnotation = TypeAnnotation; -exports.typeCastExpression = exports.TypeCastExpression = TypeCastExpression; -exports.typeParameter = exports.TypeParameter = TypeParameter; -exports.typeParameterDeclaration = exports.TypeParameterDeclaration = TypeParameterDeclaration; -exports.typeParameterInstantiation = exports.TypeParameterInstantiation = TypeParameterInstantiation; -exports.unionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation; -exports.variance = exports.Variance = Variance; -exports.voidTypeAnnotation = exports.VoidTypeAnnotation = VoidTypeAnnotation; -exports.jSXAttribute = exports.jsxAttribute = exports.JSXAttribute = JSXAttribute; -exports.jSXClosingElement = exports.jsxClosingElement = exports.JSXClosingElement = JSXClosingElement; -exports.jSXElement = exports.jsxElement = exports.JSXElement = JSXElement; -exports.jSXEmptyExpression = exports.jsxEmptyExpression = exports.JSXEmptyExpression = JSXEmptyExpression; -exports.jSXExpressionContainer = exports.jsxExpressionContainer = exports.JSXExpressionContainer = JSXExpressionContainer; -exports.jSXSpreadChild = exports.jsxSpreadChild = exports.JSXSpreadChild = JSXSpreadChild; -exports.jSXIdentifier = exports.jsxIdentifier = exports.JSXIdentifier = JSXIdentifier; -exports.jSXMemberExpression = exports.jsxMemberExpression = exports.JSXMemberExpression = JSXMemberExpression; -exports.jSXNamespacedName = exports.jsxNamespacedName = exports.JSXNamespacedName = JSXNamespacedName; -exports.jSXOpeningElement = exports.jsxOpeningElement = exports.JSXOpeningElement = JSXOpeningElement; -exports.jSXSpreadAttribute = exports.jsxSpreadAttribute = exports.JSXSpreadAttribute = JSXSpreadAttribute; -exports.jSXText = exports.jsxText = exports.JSXText = JSXText; -exports.jSXFragment = exports.jsxFragment = exports.JSXFragment = JSXFragment; -exports.jSXOpeningFragment = exports.jsxOpeningFragment = exports.JSXOpeningFragment = JSXOpeningFragment; -exports.jSXClosingFragment = exports.jsxClosingFragment = exports.JSXClosingFragment = JSXClosingFragment; -exports.noop = exports.Noop = Noop; -exports.placeholder = exports.Placeholder = Placeholder; -exports.argumentPlaceholder = exports.ArgumentPlaceholder = ArgumentPlaceholder; -exports.awaitExpression = exports.AwaitExpression = AwaitExpression; -exports.bindExpression = exports.BindExpression = BindExpression; -exports.classProperty = exports.ClassProperty = ClassProperty; -exports.optionalMemberExpression = exports.OptionalMemberExpression = OptionalMemberExpression; -exports.pipelineTopicExpression = exports.PipelineTopicExpression = PipelineTopicExpression; -exports.pipelineBareFunction = exports.PipelineBareFunction = PipelineBareFunction; -exports.pipelinePrimaryTopicReference = exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference; -exports.optionalCallExpression = exports.OptionalCallExpression = OptionalCallExpression; -exports.classPrivateProperty = exports.ClassPrivateProperty = ClassPrivateProperty; -exports.classPrivateMethod = exports.ClassPrivateMethod = ClassPrivateMethod; -exports.import = exports.Import = Import; -exports.decorator = exports.Decorator = Decorator; -exports.doExpression = exports.DoExpression = DoExpression; -exports.exportDefaultSpecifier = exports.ExportDefaultSpecifier = ExportDefaultSpecifier; -exports.exportNamespaceSpecifier = exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier; -exports.privateName = exports.PrivateName = PrivateName; -exports.bigIntLiteral = exports.BigIntLiteral = BigIntLiteral; -exports.tSParameterProperty = exports.tsParameterProperty = exports.TSParameterProperty = TSParameterProperty; -exports.tSDeclareFunction = exports.tsDeclareFunction = exports.TSDeclareFunction = TSDeclareFunction; -exports.tSDeclareMethod = exports.tsDeclareMethod = exports.TSDeclareMethod = TSDeclareMethod; -exports.tSQualifiedName = exports.tsQualifiedName = exports.TSQualifiedName = TSQualifiedName; -exports.tSCallSignatureDeclaration = exports.tsCallSignatureDeclaration = exports.TSCallSignatureDeclaration = TSCallSignatureDeclaration; -exports.tSConstructSignatureDeclaration = exports.tsConstructSignatureDeclaration = exports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration; -exports.tSPropertySignature = exports.tsPropertySignature = exports.TSPropertySignature = TSPropertySignature; -exports.tSMethodSignature = exports.tsMethodSignature = exports.TSMethodSignature = TSMethodSignature; -exports.tSIndexSignature = exports.tsIndexSignature = exports.TSIndexSignature = TSIndexSignature; -exports.tSAnyKeyword = exports.tsAnyKeyword = exports.TSAnyKeyword = TSAnyKeyword; -exports.tSUnknownKeyword = exports.tsUnknownKeyword = exports.TSUnknownKeyword = TSUnknownKeyword; -exports.tSNumberKeyword = exports.tsNumberKeyword = exports.TSNumberKeyword = TSNumberKeyword; -exports.tSObjectKeyword = exports.tsObjectKeyword = exports.TSObjectKeyword = TSObjectKeyword; -exports.tSBooleanKeyword = exports.tsBooleanKeyword = exports.TSBooleanKeyword = TSBooleanKeyword; -exports.tSStringKeyword = exports.tsStringKeyword = exports.TSStringKeyword = TSStringKeyword; -exports.tSSymbolKeyword = exports.tsSymbolKeyword = exports.TSSymbolKeyword = TSSymbolKeyword; -exports.tSVoidKeyword = exports.tsVoidKeyword = exports.TSVoidKeyword = TSVoidKeyword; -exports.tSUndefinedKeyword = exports.tsUndefinedKeyword = exports.TSUndefinedKeyword = TSUndefinedKeyword; -exports.tSNullKeyword = exports.tsNullKeyword = exports.TSNullKeyword = TSNullKeyword; -exports.tSNeverKeyword = exports.tsNeverKeyword = exports.TSNeverKeyword = TSNeverKeyword; -exports.tSThisType = exports.tsThisType = exports.TSThisType = TSThisType; -exports.tSFunctionType = exports.tsFunctionType = exports.TSFunctionType = TSFunctionType; -exports.tSConstructorType = exports.tsConstructorType = exports.TSConstructorType = TSConstructorType; -exports.tSTypeReference = exports.tsTypeReference = exports.TSTypeReference = TSTypeReference; -exports.tSTypePredicate = exports.tsTypePredicate = exports.TSTypePredicate = TSTypePredicate; -exports.tSTypeQuery = exports.tsTypeQuery = exports.TSTypeQuery = TSTypeQuery; -exports.tSTypeLiteral = exports.tsTypeLiteral = exports.TSTypeLiteral = TSTypeLiteral; -exports.tSArrayType = exports.tsArrayType = exports.TSArrayType = TSArrayType; -exports.tSTupleType = exports.tsTupleType = exports.TSTupleType = TSTupleType; -exports.tSOptionalType = exports.tsOptionalType = exports.TSOptionalType = TSOptionalType; -exports.tSRestType = exports.tsRestType = exports.TSRestType = TSRestType; -exports.tSUnionType = exports.tsUnionType = exports.TSUnionType = TSUnionType; -exports.tSIntersectionType = exports.tsIntersectionType = exports.TSIntersectionType = TSIntersectionType; -exports.tSConditionalType = exports.tsConditionalType = exports.TSConditionalType = TSConditionalType; -exports.tSInferType = exports.tsInferType = exports.TSInferType = TSInferType; -exports.tSParenthesizedType = exports.tsParenthesizedType = exports.TSParenthesizedType = TSParenthesizedType; -exports.tSTypeOperator = exports.tsTypeOperator = exports.TSTypeOperator = TSTypeOperator; -exports.tSIndexedAccessType = exports.tsIndexedAccessType = exports.TSIndexedAccessType = TSIndexedAccessType; -exports.tSMappedType = exports.tsMappedType = exports.TSMappedType = TSMappedType; -exports.tSLiteralType = exports.tsLiteralType = exports.TSLiteralType = TSLiteralType; -exports.tSExpressionWithTypeArguments = exports.tsExpressionWithTypeArguments = exports.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments; -exports.tSInterfaceDeclaration = exports.tsInterfaceDeclaration = exports.TSInterfaceDeclaration = TSInterfaceDeclaration; -exports.tSInterfaceBody = exports.tsInterfaceBody = exports.TSInterfaceBody = TSInterfaceBody; -exports.tSTypeAliasDeclaration = exports.tsTypeAliasDeclaration = exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration; -exports.tSAsExpression = exports.tsAsExpression = exports.TSAsExpression = TSAsExpression; -exports.tSTypeAssertion = exports.tsTypeAssertion = exports.TSTypeAssertion = TSTypeAssertion; -exports.tSEnumDeclaration = exports.tsEnumDeclaration = exports.TSEnumDeclaration = TSEnumDeclaration; -exports.tSEnumMember = exports.tsEnumMember = exports.TSEnumMember = TSEnumMember; -exports.tSModuleDeclaration = exports.tsModuleDeclaration = exports.TSModuleDeclaration = TSModuleDeclaration; -exports.tSModuleBlock = exports.tsModuleBlock = exports.TSModuleBlock = TSModuleBlock; -exports.tSImportType = exports.tsImportType = exports.TSImportType = TSImportType; -exports.tSImportEqualsDeclaration = exports.tsImportEqualsDeclaration = exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration; -exports.tSExternalModuleReference = exports.tsExternalModuleReference = exports.TSExternalModuleReference = TSExternalModuleReference; -exports.tSNonNullExpression = exports.tsNonNullExpression = exports.TSNonNullExpression = TSNonNullExpression; -exports.tSExportAssignment = exports.tsExportAssignment = exports.TSExportAssignment = TSExportAssignment; -exports.tSNamespaceExportDeclaration = exports.tsNamespaceExportDeclaration = exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration; -exports.tSTypeAnnotation = exports.tsTypeAnnotation = exports.TSTypeAnnotation = TSTypeAnnotation; -exports.tSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation; -exports.tSTypeParameterDeclaration = exports.tsTypeParameterDeclaration = exports.TSTypeParameterDeclaration = TSTypeParameterDeclaration; -exports.tSTypeParameter = exports.tsTypeParameter = exports.TSTypeParameter = TSTypeParameter; -exports.numberLiteral = exports.NumberLiteral = NumberLiteral; -exports.regexLiteral = exports.RegexLiteral = RegexLiteral; -exports.restProperty = exports.RestProperty = RestProperty; -exports.spreadProperty = exports.SpreadProperty = SpreadProperty; - -var _builder = _interopRequireDefault(require("../builder")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function ArrayExpression(...args) { - return (0, _builder.default)("ArrayExpression", ...args); -} - -function AssignmentExpression(...args) { - return (0, _builder.default)("AssignmentExpression", ...args); -} - -function BinaryExpression(...args) { - return (0, _builder.default)("BinaryExpression", ...args); -} - -function InterpreterDirective(...args) { - return (0, _builder.default)("InterpreterDirective", ...args); -} - -function Directive(...args) { - return (0, _builder.default)("Directive", ...args); -} - -function DirectiveLiteral(...args) { - return (0, _builder.default)("DirectiveLiteral", ...args); -} - -function BlockStatement(...args) { - return (0, _builder.default)("BlockStatement", ...args); -} - -function BreakStatement(...args) { - return (0, _builder.default)("BreakStatement", ...args); -} - -function CallExpression(...args) { - return (0, _builder.default)("CallExpression", ...args); -} - -function CatchClause(...args) { - return (0, _builder.default)("CatchClause", ...args); -} - -function ConditionalExpression(...args) { - return (0, _builder.default)("ConditionalExpression", ...args); -} - -function ContinueStatement(...args) { - return (0, _builder.default)("ContinueStatement", ...args); -} - -function DebuggerStatement(...args) { - return (0, _builder.default)("DebuggerStatement", ...args); -} - -function DoWhileStatement(...args) { - return (0, _builder.default)("DoWhileStatement", ...args); -} - -function EmptyStatement(...args) { - return (0, _builder.default)("EmptyStatement", ...args); -} - -function ExpressionStatement(...args) { - return (0, _builder.default)("ExpressionStatement", ...args); -} - -function File(...args) { - return (0, _builder.default)("File", ...args); -} - -function ForInStatement(...args) { - return (0, _builder.default)("ForInStatement", ...args); -} - -function ForStatement(...args) { - return (0, _builder.default)("ForStatement", ...args); -} - -function FunctionDeclaration(...args) { - return (0, _builder.default)("FunctionDeclaration", ...args); -} - -function FunctionExpression(...args) { - return (0, _builder.default)("FunctionExpression", ...args); -} - -function Identifier(...args) { - return (0, _builder.default)("Identifier", ...args); -} - -function IfStatement(...args) { - return (0, _builder.default)("IfStatement", ...args); -} - -function LabeledStatement(...args) { - return (0, _builder.default)("LabeledStatement", ...args); -} - -function StringLiteral(...args) { - return (0, _builder.default)("StringLiteral", ...args); -} - -function NumericLiteral(...args) { - return (0, _builder.default)("NumericLiteral", ...args); -} - -function NullLiteral(...args) { - return (0, _builder.default)("NullLiteral", ...args); -} - -function BooleanLiteral(...args) { - return (0, _builder.default)("BooleanLiteral", ...args); -} - -function RegExpLiteral(...args) { - return (0, _builder.default)("RegExpLiteral", ...args); -} - -function LogicalExpression(...args) { - return (0, _builder.default)("LogicalExpression", ...args); -} - -function MemberExpression(...args) { - return (0, _builder.default)("MemberExpression", ...args); -} - -function NewExpression(...args) { - return (0, _builder.default)("NewExpression", ...args); -} - -function Program(...args) { - return (0, _builder.default)("Program", ...args); -} - -function ObjectExpression(...args) { - return (0, _builder.default)("ObjectExpression", ...args); -} - -function ObjectMethod(...args) { - return (0, _builder.default)("ObjectMethod", ...args); -} - -function ObjectProperty(...args) { - return (0, _builder.default)("ObjectProperty", ...args); -} - -function RestElement(...args) { - return (0, _builder.default)("RestElement", ...args); -} - -function ReturnStatement(...args) { - return (0, _builder.default)("ReturnStatement", ...args); -} - -function SequenceExpression(...args) { - return (0, _builder.default)("SequenceExpression", ...args); -} - -function ParenthesizedExpression(...args) { - return (0, _builder.default)("ParenthesizedExpression", ...args); -} - -function SwitchCase(...args) { - return (0, _builder.default)("SwitchCase", ...args); -} - -function SwitchStatement(...args) { - return (0, _builder.default)("SwitchStatement", ...args); -} - -function ThisExpression(...args) { - return (0, _builder.default)("ThisExpression", ...args); -} - -function ThrowStatement(...args) { - return (0, _builder.default)("ThrowStatement", ...args); -} - -function TryStatement(...args) { - return (0, _builder.default)("TryStatement", ...args); -} - -function UnaryExpression(...args) { - return (0, _builder.default)("UnaryExpression", ...args); -} - -function UpdateExpression(...args) { - return (0, _builder.default)("UpdateExpression", ...args); -} - -function VariableDeclaration(...args) { - return (0, _builder.default)("VariableDeclaration", ...args); -} - -function VariableDeclarator(...args) { - return (0, _builder.default)("VariableDeclarator", ...args); -} - -function WhileStatement(...args) { - return (0, _builder.default)("WhileStatement", ...args); -} - -function WithStatement(...args) { - return (0, _builder.default)("WithStatement", ...args); -} - -function AssignmentPattern(...args) { - return (0, _builder.default)("AssignmentPattern", ...args); -} - -function ArrayPattern(...args) { - return (0, _builder.default)("ArrayPattern", ...args); -} - -function ArrowFunctionExpression(...args) { - return (0, _builder.default)("ArrowFunctionExpression", ...args); -} - -function ClassBody(...args) { - return (0, _builder.default)("ClassBody", ...args); -} - -function ClassDeclaration(...args) { - return (0, _builder.default)("ClassDeclaration", ...args); -} - -function ClassExpression(...args) { - return (0, _builder.default)("ClassExpression", ...args); -} - -function ExportAllDeclaration(...args) { - return (0, _builder.default)("ExportAllDeclaration", ...args); -} - -function ExportDefaultDeclaration(...args) { - return (0, _builder.default)("ExportDefaultDeclaration", ...args); -} - -function ExportNamedDeclaration(...args) { - return (0, _builder.default)("ExportNamedDeclaration", ...args); -} - -function ExportSpecifier(...args) { - return (0, _builder.default)("ExportSpecifier", ...args); -} - -function ForOfStatement(...args) { - return (0, _builder.default)("ForOfStatement", ...args); -} - -function ImportDeclaration(...args) { - return (0, _builder.default)("ImportDeclaration", ...args); -} - -function ImportDefaultSpecifier(...args) { - return (0, _builder.default)("ImportDefaultSpecifier", ...args); -} - -function ImportNamespaceSpecifier(...args) { - return (0, _builder.default)("ImportNamespaceSpecifier", ...args); -} - -function ImportSpecifier(...args) { - return (0, _builder.default)("ImportSpecifier", ...args); -} - -function MetaProperty(...args) { - return (0, _builder.default)("MetaProperty", ...args); -} - -function ClassMethod(...args) { - return (0, _builder.default)("ClassMethod", ...args); -} - -function ObjectPattern(...args) { - return (0, _builder.default)("ObjectPattern", ...args); -} - -function SpreadElement(...args) { - return (0, _builder.default)("SpreadElement", ...args); -} - -function Super(...args) { - return (0, _builder.default)("Super", ...args); -} - -function TaggedTemplateExpression(...args) { - return (0, _builder.default)("TaggedTemplateExpression", ...args); -} - -function TemplateElement(...args) { - return (0, _builder.default)("TemplateElement", ...args); -} - -function TemplateLiteral(...args) { - return (0, _builder.default)("TemplateLiteral", ...args); -} - -function YieldExpression(...args) { - return (0, _builder.default)("YieldExpression", ...args); -} - -function AnyTypeAnnotation(...args) { - return (0, _builder.default)("AnyTypeAnnotation", ...args); -} - -function ArrayTypeAnnotation(...args) { - return (0, _builder.default)("ArrayTypeAnnotation", ...args); -} - -function BooleanTypeAnnotation(...args) { - return (0, _builder.default)("BooleanTypeAnnotation", ...args); -} - -function BooleanLiteralTypeAnnotation(...args) { - return (0, _builder.default)("BooleanLiteralTypeAnnotation", ...args); -} - -function NullLiteralTypeAnnotation(...args) { - return (0, _builder.default)("NullLiteralTypeAnnotation", ...args); -} - -function ClassImplements(...args) { - return (0, _builder.default)("ClassImplements", ...args); -} - -function DeclareClass(...args) { - return (0, _builder.default)("DeclareClass", ...args); -} - -function DeclareFunction(...args) { - return (0, _builder.default)("DeclareFunction", ...args); -} - -function DeclareInterface(...args) { - return (0, _builder.default)("DeclareInterface", ...args); -} - -function DeclareModule(...args) { - return (0, _builder.default)("DeclareModule", ...args); -} - -function DeclareModuleExports(...args) { - return (0, _builder.default)("DeclareModuleExports", ...args); -} - -function DeclareTypeAlias(...args) { - return (0, _builder.default)("DeclareTypeAlias", ...args); -} - -function DeclareOpaqueType(...args) { - return (0, _builder.default)("DeclareOpaqueType", ...args); -} - -function DeclareVariable(...args) { - return (0, _builder.default)("DeclareVariable", ...args); -} - -function DeclareExportDeclaration(...args) { - return (0, _builder.default)("DeclareExportDeclaration", ...args); -} - -function DeclareExportAllDeclaration(...args) { - return (0, _builder.default)("DeclareExportAllDeclaration", ...args); -} - -function DeclaredPredicate(...args) { - return (0, _builder.default)("DeclaredPredicate", ...args); -} - -function ExistsTypeAnnotation(...args) { - return (0, _builder.default)("ExistsTypeAnnotation", ...args); -} - -function FunctionTypeAnnotation(...args) { - return (0, _builder.default)("FunctionTypeAnnotation", ...args); -} - -function FunctionTypeParam(...args) { - return (0, _builder.default)("FunctionTypeParam", ...args); -} - -function GenericTypeAnnotation(...args) { - return (0, _builder.default)("GenericTypeAnnotation", ...args); -} - -function InferredPredicate(...args) { - return (0, _builder.default)("InferredPredicate", ...args); -} - -function InterfaceExtends(...args) { - return (0, _builder.default)("InterfaceExtends", ...args); -} - -function InterfaceDeclaration(...args) { - return (0, _builder.default)("InterfaceDeclaration", ...args); -} - -function InterfaceTypeAnnotation(...args) { - return (0, _builder.default)("InterfaceTypeAnnotation", ...args); -} - -function IntersectionTypeAnnotation(...args) { - return (0, _builder.default)("IntersectionTypeAnnotation", ...args); -} - -function MixedTypeAnnotation(...args) { - return (0, _builder.default)("MixedTypeAnnotation", ...args); -} - -function EmptyTypeAnnotation(...args) { - return (0, _builder.default)("EmptyTypeAnnotation", ...args); -} - -function NullableTypeAnnotation(...args) { - return (0, _builder.default)("NullableTypeAnnotation", ...args); -} - -function NumberLiteralTypeAnnotation(...args) { - return (0, _builder.default)("NumberLiteralTypeAnnotation", ...args); -} - -function NumberTypeAnnotation(...args) { - return (0, _builder.default)("NumberTypeAnnotation", ...args); -} - -function ObjectTypeAnnotation(...args) { - return (0, _builder.default)("ObjectTypeAnnotation", ...args); -} - -function ObjectTypeInternalSlot(...args) { - return (0, _builder.default)("ObjectTypeInternalSlot", ...args); -} - -function ObjectTypeCallProperty(...args) { - return (0, _builder.default)("ObjectTypeCallProperty", ...args); -} - -function ObjectTypeIndexer(...args) { - return (0, _builder.default)("ObjectTypeIndexer", ...args); -} - -function ObjectTypeProperty(...args) { - return (0, _builder.default)("ObjectTypeProperty", ...args); -} - -function ObjectTypeSpreadProperty(...args) { - return (0, _builder.default)("ObjectTypeSpreadProperty", ...args); -} - -function OpaqueType(...args) { - return (0, _builder.default)("OpaqueType", ...args); -} - -function QualifiedTypeIdentifier(...args) { - return (0, _builder.default)("QualifiedTypeIdentifier", ...args); -} - -function StringLiteralTypeAnnotation(...args) { - return (0, _builder.default)("StringLiteralTypeAnnotation", ...args); -} - -function StringTypeAnnotation(...args) { - return (0, _builder.default)("StringTypeAnnotation", ...args); -} - -function ThisTypeAnnotation(...args) { - return (0, _builder.default)("ThisTypeAnnotation", ...args); -} - -function TupleTypeAnnotation(...args) { - return (0, _builder.default)("TupleTypeAnnotation", ...args); -} - -function TypeofTypeAnnotation(...args) { - return (0, _builder.default)("TypeofTypeAnnotation", ...args); -} - -function TypeAlias(...args) { - return (0, _builder.default)("TypeAlias", ...args); -} - -function TypeAnnotation(...args) { - return (0, _builder.default)("TypeAnnotation", ...args); -} - -function TypeCastExpression(...args) { - return (0, _builder.default)("TypeCastExpression", ...args); -} - -function TypeParameter(...args) { - return (0, _builder.default)("TypeParameter", ...args); -} - -function TypeParameterDeclaration(...args) { - return (0, _builder.default)("TypeParameterDeclaration", ...args); -} - -function TypeParameterInstantiation(...args) { - return (0, _builder.default)("TypeParameterInstantiation", ...args); -} - -function UnionTypeAnnotation(...args) { - return (0, _builder.default)("UnionTypeAnnotation", ...args); -} - -function Variance(...args) { - return (0, _builder.default)("Variance", ...args); -} - -function VoidTypeAnnotation(...args) { - return (0, _builder.default)("VoidTypeAnnotation", ...args); -} - -function JSXAttribute(...args) { - return (0, _builder.default)("JSXAttribute", ...args); -} - -function JSXClosingElement(...args) { - return (0, _builder.default)("JSXClosingElement", ...args); -} - -function JSXElement(...args) { - return (0, _builder.default)("JSXElement", ...args); -} - -function JSXEmptyExpression(...args) { - return (0, _builder.default)("JSXEmptyExpression", ...args); -} - -function JSXExpressionContainer(...args) { - return (0, _builder.default)("JSXExpressionContainer", ...args); -} - -function JSXSpreadChild(...args) { - return (0, _builder.default)("JSXSpreadChild", ...args); -} - -function JSXIdentifier(...args) { - return (0, _builder.default)("JSXIdentifier", ...args); -} - -function JSXMemberExpression(...args) { - return (0, _builder.default)("JSXMemberExpression", ...args); -} - -function JSXNamespacedName(...args) { - return (0, _builder.default)("JSXNamespacedName", ...args); -} - -function JSXOpeningElement(...args) { - return (0, _builder.default)("JSXOpeningElement", ...args); -} - -function JSXSpreadAttribute(...args) { - return (0, _builder.default)("JSXSpreadAttribute", ...args); -} - -function JSXText(...args) { - return (0, _builder.default)("JSXText", ...args); -} - -function JSXFragment(...args) { - return (0, _builder.default)("JSXFragment", ...args); -} - -function JSXOpeningFragment(...args) { - return (0, _builder.default)("JSXOpeningFragment", ...args); -} - -function JSXClosingFragment(...args) { - return (0, _builder.default)("JSXClosingFragment", ...args); -} - -function Noop(...args) { - return (0, _builder.default)("Noop", ...args); -} - -function Placeholder(...args) { - return (0, _builder.default)("Placeholder", ...args); -} - -function ArgumentPlaceholder(...args) { - return (0, _builder.default)("ArgumentPlaceholder", ...args); -} - -function AwaitExpression(...args) { - return (0, _builder.default)("AwaitExpression", ...args); -} - -function BindExpression(...args) { - return (0, _builder.default)("BindExpression", ...args); -} - -function ClassProperty(...args) { - return (0, _builder.default)("ClassProperty", ...args); -} - -function OptionalMemberExpression(...args) { - return (0, _builder.default)("OptionalMemberExpression", ...args); -} - -function PipelineTopicExpression(...args) { - return (0, _builder.default)("PipelineTopicExpression", ...args); -} - -function PipelineBareFunction(...args) { - return (0, _builder.default)("PipelineBareFunction", ...args); -} - -function PipelinePrimaryTopicReference(...args) { - return (0, _builder.default)("PipelinePrimaryTopicReference", ...args); -} - -function OptionalCallExpression(...args) { - return (0, _builder.default)("OptionalCallExpression", ...args); -} - -function ClassPrivateProperty(...args) { - return (0, _builder.default)("ClassPrivateProperty", ...args); -} - -function ClassPrivateMethod(...args) { - return (0, _builder.default)("ClassPrivateMethod", ...args); -} - -function Import(...args) { - return (0, _builder.default)("Import", ...args); -} - -function Decorator(...args) { - return (0, _builder.default)("Decorator", ...args); -} - -function DoExpression(...args) { - return (0, _builder.default)("DoExpression", ...args); -} - -function ExportDefaultSpecifier(...args) { - return (0, _builder.default)("ExportDefaultSpecifier", ...args); -} - -function ExportNamespaceSpecifier(...args) { - return (0, _builder.default)("ExportNamespaceSpecifier", ...args); -} - -function PrivateName(...args) { - return (0, _builder.default)("PrivateName", ...args); -} - -function BigIntLiteral(...args) { - return (0, _builder.default)("BigIntLiteral", ...args); -} - -function TSParameterProperty(...args) { - return (0, _builder.default)("TSParameterProperty", ...args); -} - -function TSDeclareFunction(...args) { - return (0, _builder.default)("TSDeclareFunction", ...args); -} - -function TSDeclareMethod(...args) { - return (0, _builder.default)("TSDeclareMethod", ...args); -} - -function TSQualifiedName(...args) { - return (0, _builder.default)("TSQualifiedName", ...args); -} - -function TSCallSignatureDeclaration(...args) { - return (0, _builder.default)("TSCallSignatureDeclaration", ...args); -} - -function TSConstructSignatureDeclaration(...args) { - return (0, _builder.default)("TSConstructSignatureDeclaration", ...args); -} - -function TSPropertySignature(...args) { - return (0, _builder.default)("TSPropertySignature", ...args); -} - -function TSMethodSignature(...args) { - return (0, _builder.default)("TSMethodSignature", ...args); -} - -function TSIndexSignature(...args) { - return (0, _builder.default)("TSIndexSignature", ...args); -} - -function TSAnyKeyword(...args) { - return (0, _builder.default)("TSAnyKeyword", ...args); -} - -function TSUnknownKeyword(...args) { - return (0, _builder.default)("TSUnknownKeyword", ...args); -} - -function TSNumberKeyword(...args) { - return (0, _builder.default)("TSNumberKeyword", ...args); -} - -function TSObjectKeyword(...args) { - return (0, _builder.default)("TSObjectKeyword", ...args); -} - -function TSBooleanKeyword(...args) { - return (0, _builder.default)("TSBooleanKeyword", ...args); -} - -function TSStringKeyword(...args) { - return (0, _builder.default)("TSStringKeyword", ...args); -} - -function TSSymbolKeyword(...args) { - return (0, _builder.default)("TSSymbolKeyword", ...args); -} - -function TSVoidKeyword(...args) { - return (0, _builder.default)("TSVoidKeyword", ...args); -} - -function TSUndefinedKeyword(...args) { - return (0, _builder.default)("TSUndefinedKeyword", ...args); -} - -function TSNullKeyword(...args) { - return (0, _builder.default)("TSNullKeyword", ...args); -} - -function TSNeverKeyword(...args) { - return (0, _builder.default)("TSNeverKeyword", ...args); -} - -function TSThisType(...args) { - return (0, _builder.default)("TSThisType", ...args); -} - -function TSFunctionType(...args) { - return (0, _builder.default)("TSFunctionType", ...args); -} - -function TSConstructorType(...args) { - return (0, _builder.default)("TSConstructorType", ...args); -} - -function TSTypeReference(...args) { - return (0, _builder.default)("TSTypeReference", ...args); -} - -function TSTypePredicate(...args) { - return (0, _builder.default)("TSTypePredicate", ...args); -} - -function TSTypeQuery(...args) { - return (0, _builder.default)("TSTypeQuery", ...args); -} - -function TSTypeLiteral(...args) { - return (0, _builder.default)("TSTypeLiteral", ...args); -} - -function TSArrayType(...args) { - return (0, _builder.default)("TSArrayType", ...args); -} - -function TSTupleType(...args) { - return (0, _builder.default)("TSTupleType", ...args); -} - -function TSOptionalType(...args) { - return (0, _builder.default)("TSOptionalType", ...args); -} - -function TSRestType(...args) { - return (0, _builder.default)("TSRestType", ...args); -} - -function TSUnionType(...args) { - return (0, _builder.default)("TSUnionType", ...args); -} - -function TSIntersectionType(...args) { - return (0, _builder.default)("TSIntersectionType", ...args); -} - -function TSConditionalType(...args) { - return (0, _builder.default)("TSConditionalType", ...args); -} - -function TSInferType(...args) { - return (0, _builder.default)("TSInferType", ...args); -} - -function TSParenthesizedType(...args) { - return (0, _builder.default)("TSParenthesizedType", ...args); -} - -function TSTypeOperator(...args) { - return (0, _builder.default)("TSTypeOperator", ...args); -} - -function TSIndexedAccessType(...args) { - return (0, _builder.default)("TSIndexedAccessType", ...args); -} - -function TSMappedType(...args) { - return (0, _builder.default)("TSMappedType", ...args); -} - -function TSLiteralType(...args) { - return (0, _builder.default)("TSLiteralType", ...args); -} - -function TSExpressionWithTypeArguments(...args) { - return (0, _builder.default)("TSExpressionWithTypeArguments", ...args); -} - -function TSInterfaceDeclaration(...args) { - return (0, _builder.default)("TSInterfaceDeclaration", ...args); -} - -function TSInterfaceBody(...args) { - return (0, _builder.default)("TSInterfaceBody", ...args); -} - -function TSTypeAliasDeclaration(...args) { - return (0, _builder.default)("TSTypeAliasDeclaration", ...args); -} - -function TSAsExpression(...args) { - return (0, _builder.default)("TSAsExpression", ...args); -} - -function TSTypeAssertion(...args) { - return (0, _builder.default)("TSTypeAssertion", ...args); -} - -function TSEnumDeclaration(...args) { - return (0, _builder.default)("TSEnumDeclaration", ...args); -} - -function TSEnumMember(...args) { - return (0, _builder.default)("TSEnumMember", ...args); -} - -function TSModuleDeclaration(...args) { - return (0, _builder.default)("TSModuleDeclaration", ...args); -} - -function TSModuleBlock(...args) { - return (0, _builder.default)("TSModuleBlock", ...args); -} - -function TSImportType(...args) { - return (0, _builder.default)("TSImportType", ...args); -} - -function TSImportEqualsDeclaration(...args) { - return (0, _builder.default)("TSImportEqualsDeclaration", ...args); -} - -function TSExternalModuleReference(...args) { - return (0, _builder.default)("TSExternalModuleReference", ...args); -} - -function TSNonNullExpression(...args) { - return (0, _builder.default)("TSNonNullExpression", ...args); -} - -function TSExportAssignment(...args) { - return (0, _builder.default)("TSExportAssignment", ...args); -} - -function TSNamespaceExportDeclaration(...args) { - return (0, _builder.default)("TSNamespaceExportDeclaration", ...args); -} - -function TSTypeAnnotation(...args) { - return (0, _builder.default)("TSTypeAnnotation", ...args); -} - -function TSTypeParameterInstantiation(...args) { - return (0, _builder.default)("TSTypeParameterInstantiation", ...args); -} - -function TSTypeParameterDeclaration(...args) { - return (0, _builder.default)("TSTypeParameterDeclaration", ...args); -} - -function TSTypeParameter(...args) { - return (0, _builder.default)("TSTypeParameter", ...args); -} - -function NumberLiteral(...args) { - console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); - return NumberLiteral("NumberLiteral", ...args); -} - -function RegexLiteral(...args) { - console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"); - return RegexLiteral("RegexLiteral", ...args); -} - -function RestProperty(...args) { - console.trace("The node type RestProperty has been renamed to RestElement"); - return RestProperty("RestProperty", ...args); -} - -function SpreadProperty(...args) { - console.trace("The node type SpreadProperty has been renamed to SpreadElement"); - return SpreadProperty("SpreadProperty", ...args); -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneNode.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneNode.js deleted file mode 100644 index ce9cb8c1f32984..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/clone/cloneNode.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cloneNode; - -var _definitions = require("../definitions"); - -const has = Function.call.bind(Object.prototype.hasOwnProperty); - -function cloneIfNode(obj, deep) { - if (obj && typeof obj.type === "string" && obj.type !== "CommentLine" && obj.type !== "CommentBlock") { - return cloneNode(obj, deep); - } - - return obj; -} - -function cloneIfNodeOrArray(obj, deep) { - if (Array.isArray(obj)) { - return obj.map(node => cloneIfNode(node, deep)); - } - - return cloneIfNode(obj, deep); -} - -function cloneNode(node, deep = true) { - if (!node) return node; - const { - type - } = node; - const newNode = { - type - }; - - if (type === "Identifier") { - newNode.name = node.name; - - if (has(node, "optional") && typeof node.optional === "boolean") { - newNode.optional = node.optional; - } - - if (has(node, "typeAnnotation")) { - newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true) : node.typeAnnotation; - } - } else if (!has(_definitions.NODE_FIELDS, type)) { - throw new Error(`Unknown node type: "${type}"`); - } else { - for (const field of Object.keys(_definitions.NODE_FIELDS[type])) { - if (has(node, field)) { - newNode[field] = deep ? cloneIfNodeOrArray(node[field], true) : node[field]; - } - } - } - - if (has(node, "loc")) { - newNode.loc = node.loc; - } - - if (has(node, "leadingComments")) { - newNode.leadingComments = node.leadingComments; - } - - if (has(node, "innerComments")) { - newNode.innerComments = node.innerComments; - } - - if (has(node, "trailingComments")) { - newNode.trailingComments = node.trailingComments; - } - - if (has(node, "extra")) { - newNode.extra = Object.assign({}, node.extra); - } - - return newNode; -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/core.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/core.js deleted file mode 100644 index d759890cf5721b..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/core.js +++ /dev/null @@ -1,725 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.patternLikeCommon = exports.functionDeclarationCommon = exports.functionTypeAnnotationCommon = exports.functionCommon = void 0; - -var _isValidIdentifier = _interopRequireDefault(require("../validators/isValidIdentifier")); - -var _constants = require("../constants"); - -var _utils = _interopRequireWildcard(require("./utils")); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -(0, _utils.default)("ArrayExpression", { - fields: { - elements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement"))), - default: [] - } - }, - visitor: ["elements"], - aliases: ["Expression"] -}); -(0, _utils.default)("AssignmentExpression", { - fields: { - operator: { - validate: (0, _utils.assertValueType)("string") - }, - left: { - validate: (0, _utils.assertNodeType)("LVal") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - builder: ["operator", "left", "right"], - visitor: ["left", "right"], - aliases: ["Expression"] -}); -(0, _utils.default)("BinaryExpression", { - builder: ["operator", "left", "right"], - fields: { - operator: { - validate: (0, _utils.assertOneOf)(..._constants.BINARY_OPERATORS) - }, - left: { - validate: (0, _utils.assertNodeType)("Expression") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - visitor: ["left", "right"], - aliases: ["Binary", "Expression"] -}); -(0, _utils.default)("InterpreterDirective", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - } -}); -(0, _utils.default)("Directive", { - visitor: ["value"], - fields: { - value: { - validate: (0, _utils.assertNodeType)("DirectiveLiteral") - } - } -}); -(0, _utils.default)("DirectiveLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - } -}); -(0, _utils.default)("BlockStatement", { - builder: ["body", "directives"], - visitor: ["directives", "body"], - fields: { - directives: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))), - default: [] - }, - body: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) - } - }, - aliases: ["Scopable", "BlockParent", "Block", "Statement"] -}); -(0, _utils.default)("BreakStatement", { - visitor: ["label"], - fields: { - label: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - } - }, - aliases: ["Statement", "Terminatorless", "CompletionStatement"] -}); -(0, _utils.default)("CallExpression", { - visitor: ["callee", "arguments", "typeParameters", "typeArguments"], - builder: ["callee", "arguments"], - aliases: ["Expression"], - fields: { - callee: { - validate: (0, _utils.assertNodeType)("Expression") - }, - arguments: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder"))) - }, - optional: { - validate: (0, _utils.assertOneOf)(true, false), - optional: true - }, - typeArguments: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), - optional: true - } - } -}); -(0, _utils.default)("CatchClause", { - visitor: ["param", "body"], - fields: { - param: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }, - aliases: ["Scopable", "BlockParent"] -}); -(0, _utils.default)("ConditionalExpression", { - visitor: ["test", "consequent", "alternate"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - consequent: { - validate: (0, _utils.assertNodeType)("Expression") - }, - alternate: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - aliases: ["Expression", "Conditional"] -}); -(0, _utils.default)("ContinueStatement", { - visitor: ["label"], - fields: { - label: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - } - }, - aliases: ["Statement", "Terminatorless", "CompletionStatement"] -}); -(0, _utils.default)("DebuggerStatement", { - aliases: ["Statement"] -}); -(0, _utils.default)("DoWhileStatement", { - visitor: ["test", "body"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - }, - aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"] -}); -(0, _utils.default)("EmptyStatement", { - aliases: ["Statement"] -}); -(0, _utils.default)("ExpressionStatement", { - visitor: ["expression"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - aliases: ["Statement", "ExpressionWrapper"] -}); -(0, _utils.default)("File", { - builder: ["program", "comments", "tokens"], - visitor: ["program"], - fields: { - program: { - validate: (0, _utils.assertNodeType)("Program") - } - } -}); -(0, _utils.default)("ForInStatement", { - visitor: ["left", "right", "body"], - aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], - fields: { - left: { - validate: (0, _utils.assertNodeType)("VariableDeclaration", "LVal") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -(0, _utils.default)("ForStatement", { - visitor: ["init", "test", "update", "body"], - aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"], - fields: { - init: { - validate: (0, _utils.assertNodeType)("VariableDeclaration", "Expression"), - optional: true - }, - test: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - update: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -const functionCommon = { - params: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty"))) - }, - generator: { - default: false, - validate: (0, _utils.assertValueType)("boolean") - }, - async: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - } -}; -exports.functionCommon = functionCommon; -const functionTypeAnnotationCommon = { - returnType: { - validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), - optional: true - } -}; -exports.functionTypeAnnotationCommon = functionTypeAnnotationCommon; -const functionDeclarationCommon = Object.assign({}, functionCommon, { - declare: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - id: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - } -}); -exports.functionDeclarationCommon = functionDeclarationCommon; -(0, _utils.default)("FunctionDeclaration", { - builder: ["id", "params", "body", "generator", "async"], - visitor: ["id", "params", "body", "returnType", "typeParameters"], - fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, { - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }), - aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"] -}); -(0, _utils.default)("FunctionExpression", { - inherits: "FunctionDeclaration", - aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], - fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { - id: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }) -}); -const patternLikeCommon = { - typeAnnotation: { - validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))) - } -}; -exports.patternLikeCommon = patternLikeCommon; -(0, _utils.default)("Identifier", { - builder: ["name"], - visitor: ["typeAnnotation", "decorators"], - aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"], - fields: Object.assign({}, patternLikeCommon, { - name: { - validate: (0, _utils.chain)(function (node, key, val) { - if (!(0, _isValidIdentifier.default)(val)) {} - }, (0, _utils.assertValueType)("string")) - }, - optional: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - } - }) -}); -(0, _utils.default)("IfStatement", { - visitor: ["test", "consequent", "alternate"], - aliases: ["Statement", "Conditional"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - consequent: { - validate: (0, _utils.assertNodeType)("Statement") - }, - alternate: { - optional: true, - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -(0, _utils.default)("LabeledStatement", { - visitor: ["label", "body"], - aliases: ["Statement"], - fields: { - label: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -(0, _utils.default)("StringLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("NumericLiteral", { - builder: ["value"], - deprecatedAlias: "NumberLiteral", - fields: { - value: { - validate: (0, _utils.assertValueType)("number") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("NullLiteral", { - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("BooleanLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("boolean") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("RegExpLiteral", { - builder: ["pattern", "flags"], - deprecatedAlias: "RegexLiteral", - aliases: ["Expression", "Literal"], - fields: { - pattern: { - validate: (0, _utils.assertValueType)("string") - }, - flags: { - validate: (0, _utils.assertValueType)("string"), - default: "" - } - } -}); -(0, _utils.default)("LogicalExpression", { - builder: ["operator", "left", "right"], - visitor: ["left", "right"], - aliases: ["Binary", "Expression"], - fields: { - operator: { - validate: (0, _utils.assertOneOf)(..._constants.LOGICAL_OPERATORS) - }, - left: { - validate: (0, _utils.assertNodeType)("Expression") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("MemberExpression", { - builder: ["object", "property", "computed", "optional"], - visitor: ["object", "property"], - aliases: ["Expression", "LVal"], - fields: { - object: { - validate: (0, _utils.assertNodeType)("Expression") - }, - property: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName"); - const computed = (0, _utils.assertNodeType)("Expression"); - return function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - }() - }, - computed: { - default: false - }, - optional: { - validate: (0, _utils.assertOneOf)(true, false), - optional: true - } - } -}); -(0, _utils.default)("NewExpression", { - inherits: "CallExpression" -}); -(0, _utils.default)("Program", { - visitor: ["directives", "body"], - builder: ["body", "directives", "sourceType", "interpreter"], - fields: { - sourceFile: { - validate: (0, _utils.assertValueType)("string") - }, - sourceType: { - validate: (0, _utils.assertOneOf)("script", "module"), - default: "script" - }, - interpreter: { - validate: (0, _utils.assertNodeType)("InterpreterDirective"), - default: null, - optional: true - }, - directives: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))), - default: [] - }, - body: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) - } - }, - aliases: ["Scopable", "BlockParent", "Block"] -}); -(0, _utils.default)("ObjectExpression", { - visitor: ["properties"], - aliases: ["Expression"], - fields: { - properties: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement"))) - } - } -}); -(0, _utils.default)("ObjectMethod", { - builder: ["kind", "key", "params", "body", "computed"], - fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { - kind: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("method", "get", "set")), - default: "method" - }, - computed: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - }, - key: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - const computed = (0, _utils.assertNodeType)("Expression"); - return function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - }() - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))) - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }), - visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], - aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"] -}); -(0, _utils.default)("ObjectProperty", { - builder: ["key", "value", "computed", "shorthand", "decorators"], - fields: { - computed: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - }, - key: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - const computed = (0, _utils.assertNodeType)("Expression"); - return function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - }() - }, - value: { - validate: (0, _utils.assertNodeType)("Expression", "PatternLike") - }, - shorthand: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } - }, - visitor: ["key", "value", "decorators"], - aliases: ["UserWhitespacable", "Property", "ObjectMember"] -}); -(0, _utils.default)("RestElement", { - visitor: ["argument", "typeAnnotation"], - builder: ["argument"], - aliases: ["LVal", "PatternLike"], - deprecatedAlias: "RestProperty", - fields: Object.assign({}, patternLikeCommon, { - argument: { - validate: (0, _utils.assertNodeType)("LVal") - } - }) -}); -(0, _utils.default)("ReturnStatement", { - visitor: ["argument"], - aliases: ["Statement", "Terminatorless", "CompletionStatement"], - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - } - } -}); -(0, _utils.default)("SequenceExpression", { - visitor: ["expressions"], - fields: { - expressions: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression"))) - } - }, - aliases: ["Expression"] -}); -(0, _utils.default)("ParenthesizedExpression", { - visitor: ["expression"], - aliases: ["Expression", "ExpressionWrapper"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("SwitchCase", { - visitor: ["test", "consequent"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - consequent: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) - } - } -}); -(0, _utils.default)("SwitchStatement", { - visitor: ["discriminant", "cases"], - aliases: ["Statement", "BlockParent", "Scopable"], - fields: { - discriminant: { - validate: (0, _utils.assertNodeType)("Expression") - }, - cases: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("SwitchCase"))) - } - } -}); -(0, _utils.default)("ThisExpression", { - aliases: ["Expression"] -}); -(0, _utils.default)("ThrowStatement", { - visitor: ["argument"], - aliases: ["Statement", "Terminatorless", "CompletionStatement"], - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("TryStatement", { - visitor: ["block", "handler", "finalizer"], - aliases: ["Statement"], - fields: { - block: { - validate: (0, _utils.assertNodeType)("BlockStatement") - }, - handler: { - optional: true, - validate: (0, _utils.assertNodeType)("CatchClause") - }, - finalizer: { - optional: true, - validate: (0, _utils.assertNodeType)("BlockStatement") - } - } -}); -(0, _utils.default)("UnaryExpression", { - builder: ["operator", "argument", "prefix"], - fields: { - prefix: { - default: true - }, - argument: { - validate: (0, _utils.assertNodeType)("Expression") - }, - operator: { - validate: (0, _utils.assertOneOf)(..._constants.UNARY_OPERATORS) - } - }, - visitor: ["argument"], - aliases: ["UnaryLike", "Expression"] -}); -(0, _utils.default)("UpdateExpression", { - builder: ["operator", "argument", "prefix"], - fields: { - prefix: { - default: false - }, - argument: { - validate: (0, _utils.assertNodeType)("Expression") - }, - operator: { - validate: (0, _utils.assertOneOf)(..._constants.UPDATE_OPERATORS) - } - }, - visitor: ["argument"], - aliases: ["Expression"] -}); -(0, _utils.default)("VariableDeclaration", { - builder: ["kind", "declarations"], - visitor: ["declarations"], - aliases: ["Statement", "Declaration"], - fields: { - declare: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - kind: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("var", "let", "const")) - }, - declarations: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("VariableDeclarator"))) - } - } -}); -(0, _utils.default)("VariableDeclarator", { - visitor: ["id", "init"], - fields: { - id: { - validate: (0, _utils.assertNodeType)("LVal") - }, - definite: { - optional: true, - validate: (0, _utils.assertValueType)("boolean") - }, - init: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("WhileStatement", { - visitor: ["test", "body"], - aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement", "Statement") - } - } -}); -(0, _utils.default)("WithStatement", { - visitor: ["object", "body"], - aliases: ["Statement"], - fields: { - object: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement", "Statement") - } - } -}); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/es2015.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/es2015.js deleted file mode 100644 index 71e01365390ebf..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/es2015.js +++ /dev/null @@ -1,401 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.classMethodOrDeclareMethodCommon = exports.classMethodOrPropertyCommon = void 0; - -var _utils = _interopRequireWildcard(require("./utils")); - -var _core = require("./core"); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -(0, _utils.default)("AssignmentPattern", { - visitor: ["left", "right", "decorators"], - builder: ["left", "right"], - aliases: ["Pattern", "PatternLike", "LVal"], - fields: Object.assign({}, _core.patternLikeCommon, { - left: { - validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))) - } - }) -}); -(0, _utils.default)("ArrayPattern", { - visitor: ["elements", "typeAnnotation"], - builder: ["elements"], - aliases: ["Pattern", "PatternLike", "LVal"], - fields: Object.assign({}, _core.patternLikeCommon, { - elements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("PatternLike"))) - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))) - } - }) -}); -(0, _utils.default)("ArrowFunctionExpression", { - builder: ["params", "body", "async"], - visitor: ["params", "body", "returnType", "typeParameters"], - aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], - fields: Object.assign({}, _core.functionCommon, _core.functionTypeAnnotationCommon, { - expression: { - validate: (0, _utils.assertValueType)("boolean") - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement", "Expression") - } - }) -}); -(0, _utils.default)("ClassBody", { - visitor: ["body"], - fields: { - body: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature"))) - } - } -}); -const classCommon = { - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("ClassBody") - }, - superClass: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - }, - superTypeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), - optional: true - }, - implements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))), - optional: true - } -}; -(0, _utils.default)("ClassDeclaration", { - builder: ["id", "superClass", "body", "decorators"], - visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"], - aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"], - fields: Object.assign({}, classCommon, { - declare: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - abstract: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - id: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } - }) -}); -(0, _utils.default)("ClassExpression", { - inherits: "ClassDeclaration", - aliases: ["Scopable", "Class", "Expression", "Pureish"], - fields: Object.assign({}, classCommon, { - id: { - optional: true, - validate: (0, _utils.assertNodeType)("Identifier") - }, - body: { - validate: (0, _utils.assertNodeType)("ClassBody") - }, - superClass: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } - }) -}); -(0, _utils.default)("ExportAllDeclaration", { - visitor: ["source"], - aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], - fields: { - source: { - validate: (0, _utils.assertNodeType)("StringLiteral") - } - } -}); -(0, _utils.default)("ExportDefaultDeclaration", { - visitor: ["declaration"], - aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], - fields: { - declaration: { - validate: (0, _utils.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression") - } - } -}); -(0, _utils.default)("ExportNamedDeclaration", { - visitor: ["declaration", "specifiers", "source"], - aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], - fields: { - declaration: { - validate: (0, _utils.assertNodeType)("Declaration"), - optional: true - }, - specifiers: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier"))) - }, - source: { - validate: (0, _utils.assertNodeType)("StringLiteral"), - optional: true - }, - exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) - } -}); -(0, _utils.default)("ExportSpecifier", { - visitor: ["local", "exported"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - exported: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("ForOfStatement", { - visitor: ["left", "right", "body"], - aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], - fields: { - left: { - validate: (0, _utils.assertNodeType)("VariableDeclaration", "LVal") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - }, - await: { - default: false, - validate: (0, _utils.assertValueType)("boolean") - } - } -}); -(0, _utils.default)("ImportDeclaration", { - visitor: ["specifiers", "source"], - aliases: ["Statement", "Declaration", "ModuleDeclaration"], - fields: { - specifiers: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier"))) - }, - source: { - validate: (0, _utils.assertNodeType)("StringLiteral") - }, - importKind: { - validate: (0, _utils.assertOneOf)("type", "typeof", "value"), - optional: true - } - } -}); -(0, _utils.default)("ImportDefaultSpecifier", { - visitor: ["local"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("ImportNamespaceSpecifier", { - visitor: ["local"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("ImportSpecifier", { - visitor: ["local", "imported"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - imported: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - importKind: { - validate: (0, _utils.assertOneOf)("type", "typeof"), - optional: true - } - } -}); -(0, _utils.default)("MetaProperty", { - visitor: ["meta", "property"], - aliases: ["Expression"], - fields: { - meta: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - property: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -const classMethodOrPropertyCommon = { - abstract: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - accessibility: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")), - optional: true - }, - static: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - computed: { - default: false, - validate: (0, _utils.assertValueType)("boolean") - }, - optional: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - key: { - validate: (0, _utils.chain)(function () { - const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - const computed = (0, _utils.assertNodeType)("Expression"); - return function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - }(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression")) - } -}; -exports.classMethodOrPropertyCommon = classMethodOrPropertyCommon; -const classMethodOrDeclareMethodCommon = Object.assign({}, _core.functionCommon, classMethodOrPropertyCommon, { - kind: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("get", "set", "method", "constructor")), - default: "method" - }, - access: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } -}); -exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon; -(0, _utils.default)("ClassMethod", { - aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"], - builder: ["kind", "key", "params", "body", "computed", "static"], - visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], - fields: Object.assign({}, classMethodOrDeclareMethodCommon, _core.functionTypeAnnotationCommon, { - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }) -}); -(0, _utils.default)("ObjectPattern", { - visitor: ["properties", "typeAnnotation", "decorators"], - builder: ["properties"], - aliases: ["Pattern", "PatternLike", "LVal"], - fields: Object.assign({}, _core.patternLikeCommon, { - properties: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("RestElement", "ObjectProperty"))) - } - }) -}); -(0, _utils.default)("SpreadElement", { - visitor: ["argument"], - aliases: ["UnaryLike"], - deprecatedAlias: "SpreadProperty", - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("Super", { - aliases: ["Expression"] -}); -(0, _utils.default)("TaggedTemplateExpression", { - visitor: ["tag", "quasi"], - aliases: ["Expression"], - fields: { - tag: { - validate: (0, _utils.assertNodeType)("Expression") - }, - quasi: { - validate: (0, _utils.assertNodeType)("TemplateLiteral") - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), - optional: true - } - } -}); -(0, _utils.default)("TemplateElement", { - builder: ["value", "tail"], - fields: { - value: { - validate: (0, _utils.assertShape)({ - raw: { - validate: (0, _utils.assertValueType)("string") - }, - cooked: { - validate: (0, _utils.assertValueType)("string"), - optional: true - } - }) - }, - tail: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - } - } -}); -(0, _utils.default)("TemplateLiteral", { - visitor: ["quasis", "expressions"], - aliases: ["Expression", "Literal"], - fields: { - quasis: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TemplateElement"))) - }, - expressions: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression"))) - } - } -}); -(0, _utils.default)("YieldExpression", { - builder: ["argument", "delegate"], - visitor: ["argument"], - aliases: ["Expression", "Terminatorless"], - fields: { - delegate: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - }, - argument: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/misc.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/misc.js deleted file mode 100644 index ecc4db67ff1a55..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/definitions/misc.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -var _utils = _interopRequireWildcard(require("./utils")); - -var _placeholders = require("./placeholders"); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -(0, _utils.default)("Noop", { - visitor: [] -}); -(0, _utils.default)("Placeholder", { - visitor: [], - builder: ["expectedNode", "name"], - fields: { - name: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - expectedNode: { - validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS) - } - } -}); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/inherit.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/inherit.js deleted file mode 100644 index 46b32efe8a5ce5..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/utils/inherit.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inherit; - -function _uniq() { - const data = _interopRequireDefault(require("lodash/uniq")); - - _uniq = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function inherit(key, child, parent) { - if (child && parent) { - child[key] = (0, _uniq().default)([].concat(child[key], parent[key]).filter(Boolean)); - } -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isScope.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isScope.js deleted file mode 100644 index c808631faf2c61..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isScope.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isScope; - -var _generated = require("./generated"); - -function isScope(node, parent) { - if ((0, _generated.isBlockStatement)(node) && (0, _generated.isFunction)(parent, { - body: node - })) { - return false; - } - - if ((0, _generated.isBlockStatement)(node) && (0, _generated.isCatchClause)(parent, { - body: node - })) { - return false; - } - - return (0, _generated.isScopable)(node); -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidIdentifier.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidIdentifier.js deleted file mode 100644 index 8c54b7ac8680db..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/lib/validators/isValidIdentifier.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isValidIdentifier; - -function _esutils() { - const data = _interopRequireDefault(require("esutils")); - - _esutils = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isValidIdentifier(name) { - if (typeof name !== "string" || _esutils().default.keyword.isReservedWordES6(name, true)) { - return false; - } else if (name === "await") { - return false; - } else { - return _esutils().default.keyword.isIdentifierNameES6(name); - } -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/package.json b/tools/node_modules/babel-eslint/node_modules/@babel/types/package.json deleted file mode 100644 index e13eb11bd5a9ed..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bundleDependencies": false, - "dependencies": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - }, - "deprecated": false, - "description": "Babel Types is a Lodash-esque utility library for AST nodes", - "devDependencies": { - "@babel/generator": "^7.5.5", - "@babel/parser": "^7.5.5" - }, - "gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43", - "homepage": "https://babeljs.io/", - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/types", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/babel-types" - }, - "types": "lib/index.d.ts", - "version": "7.5.5" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/flow.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/flow.js deleted file mode 100644 index daab2411d74235..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/flow.js +++ /dev/null @@ -1,153 +0,0 @@ -"use strict"; - -const t = require("../../"); -const stringifyValidator = require("../utils/stringifyValidator"); -const toFunctionName = require("../utils/toFunctionName"); - -const NODE_PREFIX = "BabelNode"; - -let code = `// NOTE: This file is autogenerated. Do not modify. -// See packages/babel-types/scripts/generators/flow.js for script used. - -declare class ${NODE_PREFIX}Comment { - value: string; - start: number; - end: number; - loc: ${NODE_PREFIX}SourceLocation; -} - -declare class ${NODE_PREFIX}CommentBlock extends ${NODE_PREFIX}Comment { - type: "CommentBlock"; -} - -declare class ${NODE_PREFIX}CommentLine extends ${NODE_PREFIX}Comment { - type: "CommentLine"; -} - -declare class ${NODE_PREFIX}SourceLocation { - start: { - line: number; - column: number; - }; - - end: { - line: number; - column: number; - }; -} - -declare class ${NODE_PREFIX} { - leadingComments?: Array<${NODE_PREFIX}Comment>; - innerComments?: Array<${NODE_PREFIX}Comment>; - trailingComments?: Array<${NODE_PREFIX}Comment>; - start: ?number; - end: ?number; - loc: ?${NODE_PREFIX}SourceLocation; -}\n\n`; - -// - -const lines = []; - -for (const type in t.NODE_FIELDS) { - const fields = t.NODE_FIELDS[type]; - - const struct = ['type: "' + type + '";']; - const args = []; - - Object.keys(t.NODE_FIELDS[type]) - .sort((fieldA, fieldB) => { - const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); - const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); - if (indexA === indexB) return fieldA < fieldB ? -1 : 1; - if (indexA === -1) return 1; - if (indexB === -1) return -1; - return indexA - indexB; - }) - .forEach(fieldName => { - const field = fields[fieldName]; - - let suffix = ""; - if (field.optional || field.default != null) suffix += "?"; - - let typeAnnotation = "any"; - - const validate = field.validate; - if (validate) { - typeAnnotation = stringifyValidator(validate, NODE_PREFIX); - } - - if (typeAnnotation) { - suffix += ": " + typeAnnotation; - } - - args.push(t.toBindingIdentifierName(fieldName) + suffix); - - if (t.isValidIdentifier(fieldName)) { - struct.push(fieldName + suffix + ";"); - } - }); - - code += `declare class ${NODE_PREFIX}${type} extends ${NODE_PREFIX} { - ${struct.join("\n ").trim()} -}\n\n`; - - // Flow chokes on super() and import() :/ - if (type !== "Super" && type !== "Import") { - lines.push( - `declare function ${toFunctionName(type)}(${args.join( - ", " - )}): ${NODE_PREFIX}${type};` - ); - } -} - -for (let i = 0; i < t.TYPES.length; i++) { - let decl = `declare function is${ - t.TYPES[i] - }(node: ?Object, opts?: ?Object): boolean`; - - if (t.NODE_FIELDS[t.TYPES[i]]) { - decl += ` %checks (node instanceof ${NODE_PREFIX}${t.TYPES[i]})`; - } - - lines.push(decl); -} - -lines.push( - `declare function validate(n: BabelNode, key: string, value: mixed): void;`, - `declare function clone(n: T): T;`, - `declare function cloneDeep(n: T): T;`, - `declare function removeProperties(n: T, opts: ?{}): void;`, - `declare function removePropertiesDeep(n: T, opts: ?{}): T;`, - `declare type TraversalAncestors = Array<{ - node: BabelNode, - key: string, - index?: number, - }>; - declare type TraversalHandler = (BabelNode, TraversalAncestors, T) => void; - declare type TraversalHandlers = { - enter?: TraversalHandler, - exit?: TraversalHandler, - };`.replace(/(^|\n) {2}/g, "$1"), - // eslint-disable-next-line - `declare function traverse(n: BabelNode, TraversalHandler | TraversalHandlers, state?: T): void;` -); - -for (const type in t.FLIPPED_ALIAS_KEYS) { - const types = t.FLIPPED_ALIAS_KEYS[type]; - code += `type ${NODE_PREFIX}${type} = ${types - .map(type => `${NODE_PREFIX}${type}`) - .join(" | ")};\n`; -} - -code += `\ndeclare module "@babel/types" { - ${lines - .join("\n") - .replace(/\n/g, "\n ") - .trim()} -}\n`; - -// - -process.stdout.write(code); diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/typescript.js b/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/typescript.js deleted file mode 100644 index b6019ec373240d..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/generators/typescript.js +++ /dev/null @@ -1,200 +0,0 @@ -"use strict"; - -const t = require("../../"); -const stringifyValidator = require("../utils/stringifyValidator"); -const toFunctionName = require("../utils/toFunctionName"); - -let code = `// NOTE: This file is autogenerated. Do not modify. -// See packages/babel-types/scripts/generators/typescript.js for script used. - -interface BaseComment { - value: string; - start: number; - end: number; - loc: SourceLocation; - type: "CommentBlock" | "CommentLine"; -} - -export interface CommentBlock extends BaseComment { - type: "CommentBlock"; -} - -export interface CommentLine extends BaseComment { - type: "CommentLine"; -} - -export type Comment = CommentBlock | CommentLine; - -export interface SourceLocation { - start: { - line: number; - column: number; - }; - - end: { - line: number; - column: number; - }; -} - -interface BaseNode { - leadingComments: ReadonlyArray | null; - innerComments: ReadonlyArray | null; - trailingComments: ReadonlyArray | null; - start: number | null; - end: number | null; - loc: SourceLocation | null; - type: Node["type"]; -} - -export type Node = ${t.TYPES.sort().join(" | ")};\n\n`; - -// - -const lines = []; - -for (const type in t.NODE_FIELDS) { - const fields = t.NODE_FIELDS[type]; - const fieldNames = sortFieldNames(Object.keys(t.NODE_FIELDS[type]), type); - - const struct = ['type: "' + type + '";']; - const args = []; - - fieldNames.forEach(fieldName => { - const field = fields[fieldName]; - let typeAnnotation = stringifyValidator(field.validate, ""); - - if (isNullable(field) && !hasDefault(field)) { - typeAnnotation += " | null"; - } - - if (areAllRemainingFieldsNullable(fieldName, fieldNames, fields)) { - args.push( - `${t.toBindingIdentifierName(fieldName)}${ - isNullable(field) ? "?:" : ":" - } ${typeAnnotation}` - ); - } else { - args.push( - `${t.toBindingIdentifierName(fieldName)}: ${typeAnnotation}${ - isNullable(field) ? " | undefined" : "" - }` - ); - } - - const alphaNumeric = /^\w+$/; - - if (t.isValidIdentifier(fieldName) || alphaNumeric.test(fieldName)) { - struct.push(`${fieldName}: ${typeAnnotation};`); - } else { - struct.push(`"${fieldName}": ${typeAnnotation};`); - } - }); - - code += `export interface ${type} extends BaseNode { - ${struct.join("\n ").trim()} -}\n\n`; - - // super and import are reserved words in JavaScript - if (type !== "Super" && type !== "Import") { - lines.push( - `export function ${toFunctionName(type)}(${args.join(", ")}): ${type};` - ); - } -} - -for (let i = 0; i < t.TYPES.length; i++) { - let decl = `export function is${ - t.TYPES[i] - }(node: object | null | undefined, opts?: object | null): `; - - if (t.NODE_FIELDS[t.TYPES[i]]) { - decl += `node is ${t.TYPES[i]};`; - } else if (t.FLIPPED_ALIAS_KEYS[t.TYPES[i]]) { - decl += `node is ${t.TYPES[i]};`; - } else { - decl += `boolean;`; - } - - lines.push(decl); -} - -lines.push( - `export function validate(n: Node, key: string, value: any): void;`, - `export function clone(n: T): T;`, - `export function cloneDeep(n: T): T;`, - `export function removeProperties( - n: Node, - opts?: { preserveComments: boolean } | null -): void;`, - `export function removePropertiesDeep( - n: T, - opts?: { preserveComments: boolean } | null -): T;`, - `export type TraversalAncestors = ReadonlyArray<{ - node: Node, - key: string, - index?: number, - }>; - export type TraversalHandler = (node: Node, parent: TraversalAncestors, type: T) => void; - export type TraversalHandlers = { - enter?: TraversalHandler, - exit?: TraversalHandler, - };`.replace(/(^|\n) {2}/g, "$1"), - // eslint-disable-next-line - `export function traverse(n: Node, h: TraversalHandler | TraversalHandlers, state?: T): void;` -); - -for (const type in t.DEPRECATED_KEYS) { - code += `/** - * @deprecated Use \`${t.DEPRECATED_KEYS[type]}\` - */ -export type ${type} = ${t.DEPRECATED_KEYS[type]};\n -`; -} - -for (const type in t.FLIPPED_ALIAS_KEYS) { - const types = t.FLIPPED_ALIAS_KEYS[type]; - code += `export type ${type} = ${types - .map(type => `${type}`) - .join(" | ")};\n`; -} -code += "\n"; - -code += "export interface Aliases {\n"; -for (const type in t.FLIPPED_ALIAS_KEYS) { - code += ` ${type}: ${type};\n`; -} -code += "}\n\n"; - -code += lines.join("\n") + "\n"; - -// - -process.stdout.write(code); - -// - -function areAllRemainingFieldsNullable(fieldName, fieldNames, fields) { - const index = fieldNames.indexOf(fieldName); - return fieldNames.slice(index).every(_ => isNullable(fields[_])); -} - -function hasDefault(field) { - return field.default != null; -} - -function isNullable(field) { - return field.optional || hasDefault(field); -} - -function sortFieldNames(fields, type) { - return fields.sort((fieldA, fieldB) => { - const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); - const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); - if (indexA === indexB) return fieldA < fieldB ? -1 : 1; - if (indexA === -1) return 1; - if (indexB === -1) return -1; - return indexA - indexB; - }); -} diff --git a/tools/node_modules/babel-eslint/node_modules/ansi-styles/package.json b/tools/node_modules/babel-eslint/node_modules/ansi-styles/package.json deleted file mode 100644 index 5663ace24b4607..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "ava": { - "require": "babel-polyfill" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-styles/issues" - }, - "bundleDependencies": false, - "dependencies": { - "color-convert": "^1.9.0" - }, - "deprecated": false, - "description": "ANSI escape codes for styling strings in the terminal", - "devDependencies": { - "ava": "*", - "babel-polyfill": "^6.23.0", - "svg-term-cli": "^2.1.1", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/ansi-styles#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "ansi-styles", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-styles.git" - }, - "scripts": { - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", - "test": "xo && ava" - }, - "version": "3.2.1" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/chalk/package.json b/tools/node_modules/babel-eslint/node_modules/chalk/package.json deleted file mode 100644 index 270fecdc347d42..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/chalk/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "bugs": { - "url": "https://github.com/chalk/chalk/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "deprecated": false, - "description": "Terminal string styling done right", - "devDependencies": { - "ava": "*", - "coveralls": "^3.0.0", - "execa": "^0.9.0", - "flow-bin": "^0.68.0", - "import-fresh": "^2.0.0", - "matcha": "^0.7.0", - "nyc": "^11.0.2", - "resolve-from": "^4.0.0", - "typescript": "^2.5.3", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "templates.js", - "types/index.d.ts", - "index.js.flow" - ], - "homepage": "https://github.com/chalk/chalk#readme", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "chalk", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/chalk.git" - }, - "scripts": { - "bench": "matcha benchmark.js", - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava" - }, - "types": "types/index.d.ts", - "version": "2.4.2", - "xo": { - "envs": [ - "node", - "mocha" - ], - "ignores": [ - "test/_flow.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/debug/dist/debug.js b/tools/node_modules/babel-eslint/node_modules/debug/dist/debug.js deleted file mode 100644 index 89ad0c2175c3d6..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/debug/dist/debug.js +++ /dev/null @@ -1,912 +0,0 @@ -"use strict"; - -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -(function (f) { - if ((typeof exports === "undefined" ? "undefined" : _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.debug = f(); - } -})(function () { - var define, module, exports; - return function () { - function r(e, n, t) { - function o(i, f) { - if (!n[i]) { - if (!e[i]) { - var c = "function" == typeof require && require; - if (!f && c) return c(i, !0); - if (u) return u(i, !0); - var a = new Error("Cannot find module '" + i + "'"); - throw a.code = "MODULE_NOT_FOUND", a; - } - - var p = n[i] = { - exports: {} - }; - e[i][0].call(p.exports, function (r) { - var n = e[i][1][r]; - return o(n || r); - }, p, p.exports, r, e, n, t); - } - - return n[i].exports; - } - - for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { - o(t[i]); - } - - return o; - } - - return r; - }()({ - 1: [function (require, module, exports) { - /** - * Helpers. - */ - var s = 1000; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - /** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - - module.exports = function (val, options) { - options = options || {}; - - var type = _typeof(val); - - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); - } - - throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); - }; - /** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - - - function parse(str) { - str = String(str); - - if (str.length > 100) { - return; - } - - var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); - - if (!match) { - return; - } - - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - - case 'weeks': - case 'week': - case 'w': - return n * w; - - case 'days': - case 'day': - case 'd': - return n * d; - - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - - default: - return undefined; - } - } - /** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtShort(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - - return ms + 'ms'; - } - /** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function fmtLong(ms) { - var msAbs = Math.abs(ms); - - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - - return ms + ' ms'; - } - /** - * Pluralization helper. - */ - - - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); - } - }, {}], - 2: [function (require, module, exports) { - // shim for using process in browser - var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it - // don't break things. But we need to wrap it in a try catch in case it is - // wrapped in strict mode code which doesn't define any globals. It's inside a - // function because try/catches deoptimize in certain engines. - - var cachedSetTimeout; - var cachedClearTimeout; - - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - - function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); - } - - (function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - })(); - - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } // if setTimeout wasn't available but was latter defined - - - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - } - - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } // if clearTimeout wasn't available but was latter defined - - - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - } - - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - - draining = false; - - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - - if (queue.length) { - drainQueue(); - } - } - - function drainQueue() { - if (draining) { - return; - } - - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - - while (len) { - currentQueue = queue; - queue = []; - - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - - queueIndex = -1; - len = queue.length; - } - - currentQueue = null; - draining = false; - runClearTimeout(timeout); - } - - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - - queue.push(new Item(fun, args)); - - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } - }; // v8 likes predictible objects - - - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - - process.versions = {}; - - function noop() {} - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - process.prependListener = noop; - process.prependOnceListener = noop; - - process.listeners = function (name) { - return []; - }; - - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - - process.cwd = function () { - return '/'; - }; - - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - - process.umask = function () { - return 0; - }; - }, {}], - 3: [function (require, module, exports) { - /** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require('ms'); - Object.keys(env).forEach(function (key) { - createDebug[key] = env[key]; - }); - /** - * Active `debug` instances. - */ - - createDebug.instances = []; - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.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". - */ - - createDebug.formatters = {}; - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - - function selectColor(namespace) { - var hash = 0; - - for (var i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - - createDebug.selectColor = selectColor; - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - - function createDebug(namespace) { - var prevTime; - - function debug() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - // Disabled? - if (!debug.enabled) { - return; - } - - var self = debug; // Set `diff` timestamp - - var curr = Number(new Date()); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // 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 = createDebug.formatters[format]; - - if (typeof formatter === 'function') { - 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.) - - createDebug.formatArgs.call(self, args); - var logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.enabled = createDebug.enabled(namespace); - debug.useColors = createDebug.useColors(); - debug.color = selectColor(namespace); - debug.destroy = destroy; - debug.extend = extend; // Debug.formatArgs = formatArgs; - // debug.rawLog = rawLog; - // env-specific initialization logic for debug instances - - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - createDebug.instances.push(debug); - return debug; - } - - function destroy() { - var index = createDebug.instances.indexOf(this); - - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - - return false; - } - - function extend(namespace, delimiter) { - var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - - - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.names = []; - createDebug.skips = []; - var i; - var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - var len = split.length; - - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } - - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - - for (i = 0; i < createDebug.instances.length; i++) { - var instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } - } - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - - - function disable() { - var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { - return '-' + namespace; - }))).join(','); - createDebug.enable(''); - return namespaces; - } - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - - - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - var i; - var len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - - return false; - } - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - - - function toNamespace(regexp) { - return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); - } - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - - - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - - return val; - } - - createDebug.enable(createDebug.load()); - return createDebug; - } - - module.exports = setup; - }, { - "ms": 1 - }], - 4: [function (require, module, exports) { - (function (process) { - /* eslint-env browser */ - - /** - * This is the web browser implementation of `debug()`. - */ - exports.log = log; - exports.formatArgs = formatArgs; - exports.save = save; - exports.load = load; - exports.useColors = useColors; - exports.storage = localstorage(); - /** - * Colors. - */ - - exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; - /** - * 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 - */ - // eslint-disable-next-line complexity - - 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' || window.process.__nwjs)) { - return true; - } // Internet Explorer and Edge do not support colors. - - - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } // 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+)/); - } - /** - * Colorize log arguments if enabled. - * - * @api public - */ - - - function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); - - if (!this.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 (match === '%c') { - // 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() { - var _console; - - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); - } - /** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - - - function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) {// Swallow - // XXX (@Qix-) should we be logging these? - } - } - /** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - - - function load() { - var r; - - try { - r = exports.storage.getItem('debug'); - } catch (error) {} // Swallow - // XXX (@Qix-) should we be logging these? - // 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; - } - /** - * 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 { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) {// Swallow - // XXX (@Qix-) should we be logging these? - } - } - - module.exports = require('./common')(exports); - var formatters = module.exports.formatters; - /** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - - formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } - }; - }).call(this, require('_process')); - }, { - "./common": 3, - "_process": 2 - }] - }, {}, [4])(4); -}); diff --git a/tools/node_modules/babel-eslint/node_modules/debug/package.json b/tools/node_modules/babel-eslint/node_modules/debug/package.json deleted file mode 100644 index 7bc94f7f061070..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/debug/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "browser": "./src/browser.js", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io" - }, - { - "name": "Andrew Rhyne", - "email": "rhyneandrew@gmail.com" - } - ], - "dependencies": { - "ms": "^2.1.1" - }, - "deprecated": false, - "description": "small debugging utility", - "devDependencies": { - "@babel/cli": "^7.0.0", - "@babel/core": "^7.0.0", - "@babel/preset-env": "^7.0.0", - "browserify": "14.4.0", - "chai": "^3.5.0", - "concurrently": "^3.1.0", - "coveralls": "^3.0.2", - "istanbul": "^0.4.5", - "karma": "^3.0.0", - "karma-chai": "^0.1.0", - "karma-mocha": "^1.3.0", - "karma-phantomjs-launcher": "^1.0.2", - "mocha": "^5.2.0", - "mocha-lcov-reporter": "^1.2.0", - "rimraf": "^2.5.4", - "xo": "^0.23.0" - }, - "files": [ - "src", - "dist/debug.js", - "LICENSE", - "README.md" - ], - "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" - }, - "scripts": { - "build": "npm run build:debug && npm run build:test", - "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", - "build:test": "babel -d dist test.js", - "clean": "rimraf dist coverage", - "lint": "xo", - "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", - "pretest:browser": "npm run build", - "test": "npm run test:node && npm run test:browser", - "test:browser": "karma start --single-run", - "test:coverage": "cat ./coverage/lcov.info | coveralls", - "test:node": "istanbul cover _mocha -- test.js" - }, - "unpkg": "./dist/debug.js", - "version": "4.1.1" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/escape-string-regexp/package.json b/tools/node_modules/babel-eslint/node_modules/escape-string-regexp/package.json deleted file mode 100644 index ced6973347e903..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/escape-string-regexp/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/escape-string-regexp/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Escape RegExp special characters", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.8.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme", - "keywords": [ - "escape", - "regex", - "regexp", - "re", - "regular", - "expression", - "string", - "str", - "special", - "characters" - ], - "license": "MIT", - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Boy Nicolai Appelman", - "email": "joshua@jbna.nl", - "url": "jbna.nl" - } - ], - "name": "escape-string-regexp", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/escape-string-regexp.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.5" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/esutils/README.md b/tools/node_modules/babel-eslint/node_modules/esutils/README.md deleted file mode 100644 index 517526cfb99b97..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/esutils/README.md +++ /dev/null @@ -1,174 +0,0 @@ -### esutils [![Build Status](https://secure.travis-ci.org/estools/esutils.svg)](http://travis-ci.org/estools/esutils) -esutils ([esutils](http://github.com/estools/esutils)) is -utility box for ECMAScript language tools. - -### API - -### ast - -#### ast.isExpression(node) - -Returns true if `node` is an Expression as defined in ECMA262 edition 5.1 section -[11](https://es5.github.io/#x11). - -#### ast.isStatement(node) - -Returns true if `node` is a Statement as defined in ECMA262 edition 5.1 section -[12](https://es5.github.io/#x12). - -#### ast.isIterationStatement(node) - -Returns true if `node` is an IterationStatement as defined in ECMA262 edition -5.1 section [12.6](https://es5.github.io/#x12.6). - -#### ast.isSourceElement(node) - -Returns true if `node` is a SourceElement as defined in ECMA262 edition 5.1 -section [14](https://es5.github.io/#x14). - -#### ast.trailingStatement(node) - -Returns `Statement?` if `node` has trailing `Statement`. -```js -if (cond) - consequent; -``` -When taking this `IfStatement`, returns `consequent;` statement. - -#### ast.isProblematicIfStatement(node) - -Returns true if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code. -```js -{ - type: 'IfStatement', - consequent: { - type: 'WithStatement', - body: { - type: 'IfStatement', - consequent: {type: 'EmptyStatement'} - } - }, - alternate: {type: 'EmptyStatement'} -} -``` -The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`. - - -### code - -#### code.isDecimalDigit(code) - -Return true if provided code is decimal digit. - -#### code.isHexDigit(code) - -Return true if provided code is hexadecimal digit. - -#### code.isOctalDigit(code) - -Return true if provided code is octal digit. - -#### code.isWhiteSpace(code) - -Return true if provided code is white space. White space characters are formally defined in ECMA262. - -#### code.isLineTerminator(code) - -Return true if provided code is line terminator. Line terminator characters are formally defined in ECMA262. - -#### code.isIdentifierStart(code) - -Return true if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262. - -#### code.isIdentifierPart(code) - -Return true if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262. - -### keyword - -#### keyword.isKeywordES5(id, strict) - -Returns `true` if provided identifier string is a Keyword or Future Reserved Word -in ECMA262 edition 5.1. They are formally defined in ECMA262 sections -[7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2), -respectively. If the `strict` flag is truthy, this function additionally checks whether -`id` is a Keyword or Future Reserved Word under strict mode. - -#### keyword.isKeywordES6(id, strict) - -Returns `true` if provided identifier string is a Keyword or Future Reserved Word -in ECMA262 edition 6. They are formally defined in ECMA262 sections -[11.6.2.1](http://ecma-international.org/ecma-262/6.0/#sec-keywords) and -[11.6.2.2](http://ecma-international.org/ecma-262/6.0/#sec-future-reserved-words), -respectively. If the `strict` flag is truthy, this function additionally checks whether -`id` is a Keyword or Future Reserved Word under strict mode. - -#### keyword.isReservedWordES5(id, strict) - -Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 5.1. -They are formally defined in ECMA262 section [7.6.1](http://es5.github.io/#x7.6.1). -If the `strict` flag is truthy, this function additionally checks whether `id` -is a Reserved Word under strict mode. - -#### keyword.isReservedWordES6(id, strict) - -Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6. -They are formally defined in ECMA262 section [11.6.2](http://ecma-international.org/ecma-262/6.0/#sec-reserved-words). -If the `strict` flag is truthy, this function additionally checks whether `id` -is a Reserved Word under strict mode. - -#### keyword.isRestrictedWord(id) - -Returns `true` if provided identifier string is one of `eval` or `arguments`. -They are restricted in strict mode code throughout ECMA262 edition 5.1 and -in ECMA262 edition 6 section [12.1.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors). - -#### keyword.isIdentifierNameES5(id) - -Return true if provided identifier string is an IdentifierName as specified in -ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). - -#### keyword.isIdentifierNameES6(id) - -Return true if provided identifier string is an IdentifierName as specified in -ECMA262 edition 6 section [11.6](http://ecma-international.org/ecma-262/6.0/#sec-names-and-keywords). - -#### keyword.isIdentifierES5(id, strict) - -Return true if provided identifier string is an Identifier as specified in -ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). If the `strict` -flag is truthy, this function additionally checks whether `id` is an Identifier -under strict mode. - -#### keyword.isIdentifierES6(id, strict) - -Return true if provided identifier string is an Identifier as specified in -ECMA262 edition 6 section [12.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers). -If the `strict` flag is truthy, this function additionally checks whether `id` -is an Identifier under strict mode. - -### License - -Copyright (C) 2013 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/babel-eslint/node_modules/esutils/lib/ast.js b/tools/node_modules/babel-eslint/node_modules/esutils/lib/ast.js deleted file mode 100644 index 8faadae1ce736d..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/esutils/lib/ast.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - 'use strict'; - - function isExpression(node) { - if (node == null) { return false; } - switch (node.type) { - case 'ArrayExpression': - case 'AssignmentExpression': - case 'BinaryExpression': - case 'CallExpression': - case 'ConditionalExpression': - case 'FunctionExpression': - case 'Identifier': - case 'Literal': - case 'LogicalExpression': - case 'MemberExpression': - case 'NewExpression': - case 'ObjectExpression': - case 'SequenceExpression': - case 'ThisExpression': - case 'UnaryExpression': - case 'UpdateExpression': - return true; - } - return false; - } - - function isIterationStatement(node) { - if (node == null) { return false; } - switch (node.type) { - case 'DoWhileStatement': - case 'ForInStatement': - case 'ForStatement': - case 'WhileStatement': - return true; - } - return false; - } - - function isStatement(node) { - if (node == null) { return false; } - switch (node.type) { - case 'BlockStatement': - case 'BreakStatement': - case 'ContinueStatement': - case 'DebuggerStatement': - case 'DoWhileStatement': - case 'EmptyStatement': - case 'ExpressionStatement': - case 'ForInStatement': - case 'ForStatement': - case 'IfStatement': - case 'LabeledStatement': - case 'ReturnStatement': - case 'SwitchStatement': - case 'ThrowStatement': - case 'TryStatement': - case 'VariableDeclaration': - case 'WhileStatement': - case 'WithStatement': - return true; - } - return false; - } - - function isSourceElement(node) { - return isStatement(node) || node != null && node.type === 'FunctionDeclaration'; - } - - function trailingStatement(node) { - switch (node.type) { - case 'IfStatement': - if (node.alternate != null) { - return node.alternate; - } - return node.consequent; - - case 'LabeledStatement': - case 'ForStatement': - case 'ForInStatement': - case 'WhileStatement': - case 'WithStatement': - return node.body; - } - return null; - } - - function isProblematicIfStatement(node) { - var current; - - if (node.type !== 'IfStatement') { - return false; - } - if (node.alternate == null) { - return false; - } - current = node.consequent; - do { - if (current.type === 'IfStatement') { - if (current.alternate == null) { - return true; - } - } - current = trailingStatement(current); - } while (current); - - return false; - } - - module.exports = { - isExpression: isExpression, - isStatement: isStatement, - isIterationStatement: isIterationStatement, - isSourceElement: isSourceElement, - isProblematicIfStatement: isProblematicIfStatement, - - trailingStatement: trailingStatement - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/esutils/lib/code.js b/tools/node_modules/babel-eslint/node_modules/esutils/lib/code.js deleted file mode 100644 index 23136af91f9fbc..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/esutils/lib/code.js +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright (C) 2013-2014 Yusuke Suzuki - Copyright (C) 2014 Ivan Nikulin - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - 'use strict'; - - var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; - - // See `tools/generate-identifier-regex.js`. - ES5Regex = { - // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u1877\u1880-\u1884\u1887-\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]/, - // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ - }; - - ES6Regex = { - // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u1877\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\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-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ - }; - - function isDecimalDigit(ch) { - return 0x30 <= ch && ch <= 0x39; // 0..9 - } - - function isHexDigit(ch) { - return 0x30 <= ch && ch <= 0x39 || // 0..9 - 0x61 <= ch && ch <= 0x66 || // a..f - 0x41 <= ch && ch <= 0x46; // A..F - } - - function isOctalDigit(ch) { - return ch >= 0x30 && ch <= 0x37; // 0..7 - } - - // 7.2 White Space - - NON_ASCII_WHITESPACES = [ - 0x1680, - 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, - 0x202F, 0x205F, - 0x3000, - 0xFEFF - ]; - - function isWhiteSpace(ch) { - return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || - ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0; - } - - // 7.3 Line Terminators - - function isLineTerminator(ch) { - return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; - } - - // 7.6 Identifier Names and Identifiers - - function fromCodePoint(cp) { - if (cp <= 0xFFFF) { return String.fromCharCode(cp); } - var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); - var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00); - return cu1 + cu2; - } - - IDENTIFIER_START = new Array(0x80); - for(ch = 0; ch < 0x80; ++ch) { - IDENTIFIER_START[ch] = - ch >= 0x61 && ch <= 0x7A || // a..z - ch >= 0x41 && ch <= 0x5A || // A..Z - ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) - } - - IDENTIFIER_PART = new Array(0x80); - for(ch = 0; ch < 0x80; ++ch) { - IDENTIFIER_PART[ch] = - ch >= 0x61 && ch <= 0x7A || // a..z - ch >= 0x41 && ch <= 0x5A || // A..Z - ch >= 0x30 && ch <= 0x39 || // 0..9 - ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) - } - - function isIdentifierStartES5(ch) { - return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); - } - - function isIdentifierPartES5(ch) { - return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); - } - - function isIdentifierStartES6(ch) { - return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); - } - - function isIdentifierPartES6(ch) { - return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); - } - - module.exports = { - isDecimalDigit: isDecimalDigit, - isHexDigit: isHexDigit, - isOctalDigit: isOctalDigit, - isWhiteSpace: isWhiteSpace, - isLineTerminator: isLineTerminator, - isIdentifierStartES5: isIdentifierStartES5, - isIdentifierPartES5: isIdentifierPartES5, - isIdentifierStartES6: isIdentifierStartES6, - isIdentifierPartES6: isIdentifierPartES6 - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/esutils/lib/keyword.js b/tools/node_modules/babel-eslint/node_modules/esutils/lib/keyword.js deleted file mode 100644 index 13c8c6a967caf0..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/esutils/lib/keyword.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - 'use strict'; - - var code = require('./code'); - - function isStrictModeReservedWordES6(id) { - switch (id) { - case 'implements': - case 'interface': - case 'package': - case 'private': - case 'protected': - case 'public': - case 'static': - case 'let': - return true; - default: - return false; - } - } - - function isKeywordES5(id, strict) { - // yield should not be treated as keyword under non-strict mode. - if (!strict && id === 'yield') { - return false; - } - return isKeywordES6(id, strict); - } - - function isKeywordES6(id, strict) { - if (strict && isStrictModeReservedWordES6(id)) { - return true; - } - - switch (id.length) { - case 2: - return (id === 'if') || (id === 'in') || (id === 'do'); - case 3: - return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); - case 4: - return (id === 'this') || (id === 'else') || (id === 'case') || - (id === 'void') || (id === 'with') || (id === 'enum'); - case 5: - return (id === 'while') || (id === 'break') || (id === 'catch') || - (id === 'throw') || (id === 'const') || (id === 'yield') || - (id === 'class') || (id === 'super'); - case 6: - return (id === 'return') || (id === 'typeof') || (id === 'delete') || - (id === 'switch') || (id === 'export') || (id === 'import'); - case 7: - return (id === 'default') || (id === 'finally') || (id === 'extends'); - case 8: - return (id === 'function') || (id === 'continue') || (id === 'debugger'); - case 10: - return (id === 'instanceof'); - default: - return false; - } - } - - function isReservedWordES5(id, strict) { - return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict); - } - - function isReservedWordES6(id, strict) { - return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict); - } - - function isRestrictedWord(id) { - return id === 'eval' || id === 'arguments'; - } - - function isIdentifierNameES5(id) { - var i, iz, ch; - - if (id.length === 0) { return false; } - - ch = id.charCodeAt(0); - if (!code.isIdentifierStartES5(ch)) { - return false; - } - - for (i = 1, iz = id.length; i < iz; ++i) { - ch = id.charCodeAt(i); - if (!code.isIdentifierPartES5(ch)) { - return false; - } - } - return true; - } - - function decodeUtf16(lead, trail) { - return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; - } - - function isIdentifierNameES6(id) { - var i, iz, ch, lowCh, check; - - if (id.length === 0) { return false; } - - check = code.isIdentifierStartES6; - for (i = 0, iz = id.length; i < iz; ++i) { - ch = id.charCodeAt(i); - if (0xD800 <= ch && ch <= 0xDBFF) { - ++i; - if (i >= iz) { return false; } - lowCh = id.charCodeAt(i); - if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) { - return false; - } - ch = decodeUtf16(ch, lowCh); - } - if (!check(ch)) { - return false; - } - check = code.isIdentifierPartES6; - } - return true; - } - - function isIdentifierES5(id, strict) { - return isIdentifierNameES5(id) && !isReservedWordES5(id, strict); - } - - function isIdentifierES6(id, strict) { - return isIdentifierNameES6(id) && !isReservedWordES6(id, strict); - } - - module.exports = { - isKeywordES5: isKeywordES5, - isKeywordES6: isKeywordES6, - isReservedWordES5: isReservedWordES5, - isReservedWordES6: isReservedWordES6, - isRestrictedWord: isRestrictedWord, - isIdentifierNameES5: isIdentifierNameES5, - isIdentifierNameES6: isIdentifierNameES6, - isIdentifierES5: isIdentifierES5, - isIdentifierES6: isIdentifierES6 - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/esutils/lib/utils.js b/tools/node_modules/babel-eslint/node_modules/esutils/lib/utils.js deleted file mode 100644 index ce18faa6bc80fa..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/esutils/lib/utils.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -(function () { - 'use strict'; - - exports.ast = require('./ast'); - exports.code = require('./code'); - exports.keyword = require('./keyword'); -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/babel-eslint/node_modules/esutils/package.json b/tools/node_modules/babel-eslint/node_modules/esutils/package.json deleted file mode 100644 index cffa439c8dafce..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/esutils/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "bugs": { - "url": "https://github.com/estools/esutils/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "utility box for ECMAScript language tools", - "devDependencies": { - "chai": "~1.7.2", - "coffee-script": "~1.6.3", - "jshint": "2.6.3", - "mocha": "~2.2.1", - "regenerate": "~1.3.1", - "unicode-9.0.0": "~0.7.0" - }, - "directories": { - "lib": "./lib" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "LICENSE.BSD", - "README.md", - "lib" - ], - "homepage": "https://github.com/estools/esutils", - "license": "BSD-2-Clause", - "main": "lib/utils.js", - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "url": "http://github.com/Constellation" - } - ], - "name": "esutils", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/estools/esutils.git" - }, - "scripts": { - "generate-regex": "node tools/generate-identifier-regex.js", - "lint": "jshint lib/*.js", - "test": "npm run-script lint && npm run-script unit-test", - "unit-test": "mocha --compilers coffee:coffee-script -R spec" - }, - "version": "2.0.3" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/globals/package.json b/tools/node_modules/babel-eslint/node_modules/globals/package.json deleted file mode 100644 index ae094f3054063e..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/globals/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/globals/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Global identifiers from different JavaScript environments", - "devDependencies": { - "ava": "0.21.0", - "xo": "0.18.0" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "globals.json" - ], - "homepage": "https://github.com/sindresorhus/globals#readme", - "keywords": [ - "globals", - "global", - "identifiers", - "variables", - "vars", - "jshint", - "eslint", - "environments" - ], - "license": "MIT", - "name": "globals", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/globals.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "11.12.0", - "xo": { - "ignores": [ - "get-browser-globals.js" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/core.min.js b/tools/node_modules/babel-eslint/node_modules/lodash/core.min.js deleted file mode 100644 index bb543ff54abc0a..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/lodash/core.min.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE - * Build: `lodash core -o ./dist/lodash.core.js` - */ -;(function(){function n(n){return H(n)&&pn.call(n,"callee")&&!yn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return j(t,function(t){return n[t]})}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function"); -return setTimeout(function(){n.apply(Z,r)},t)}function f(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function a(n,t,r){for(var e=-1,u=n.length;++et}function b(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!H(t)?n!==n&&t!==t:y(n,t,r,e,b,u))}function y(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,function(t){return t[0]==n}),s=An(o,function(n){ -return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=T(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=J(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 1&r||(i=l&&pn.call(n,"__wrapped__"),f=c&&pn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=B(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t, -r=u(i,f,r,e,o),o.pop(),r)}function g(n){return typeof n=="function"?n:null==n?X:(typeof n=="object"?d:r)(n)}function _(n,t){return nt&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++ei))return false;for(var c=-1,f=true,a=2&r?[]:Z;++cr?jn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,mn)}function G(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Fn(n), -function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!==n&&t!==t}function M(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1=t),t&&!U(n)}function U(n){return!!V(n)&&(n=hn.call(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function V(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function H(n){return null!=n&&typeof n=="object"}function K(n){ -return typeof n=="number"||H(n)&&"[object Number]"==hn.call(n)}function L(n){return typeof n=="string"||!Nn(n)&&H(n)&&"[object String]"==hn.call(n)}function Q(n){return typeof n=="string"?n:null==n?"":n+""}function W(n){return null==n?[]:u(n,Dn(n))}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=h(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n);return mn(o,function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__; -if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var Z,nn=1/0,tn=/[&<>"']/g,rn=RegExp(tn.source),en=/^(?:0|[1-9]\d*)$/,un=typeof self=="object"&&self&&self.Object===Object&&self,on=typeof global=="object"&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,fn=function(n){ -return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,bn=Object.create,yn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return V(t)?bn?bn(t):(n.prototype=t,t=new n,n.prototype=Z,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i; -var mn=function(n,t){return function(r,e){if(null==r)return r;if(!M(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++or&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r"']/g,G=RegExp(V.source),H=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nn=/^\w*$/,tn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,en=RegExp(rn.source),un=/^\s+|\s+$/g,on=/^\s+/,fn=/\s+$/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,an=/\{\n\/\* \[wrapped with (.+)\] \*/,ln=/,? & /,sn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hn=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_n=/\w*$/,vn=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,dn=/^\[object .+?Constructor\]$/,yn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jn=/($^)/,wn=/['\n\r\u2028\u2029\\]/g,mn="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*",An="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,En="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",kn=RegExp("['\u2019]","g"),Sn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),On=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+En+mn,"g"),In=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",An].join("|"),"g"),Rn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),zn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Bn={}; -Bn["[object Float32Array]"]=Bn["[object Float64Array]"]=Bn["[object Int8Array]"]=Bn["[object Int16Array]"]=Bn["[object Int32Array]"]=Bn["[object Uint8Array]"]=Bn["[object Uint8ClampedArray]"]=Bn["[object Uint16Array]"]=Bn["[object Uint32Array]"]=true,Bn["[object Arguments]"]=Bn["[object Array]"]=Bn["[object ArrayBuffer]"]=Bn["[object Boolean]"]=Bn["[object DataView]"]=Bn["[object Date]"]=Bn["[object Error]"]=Bn["[object Function]"]=Bn["[object Map]"]=Bn["[object Number]"]=Bn["[object Object]"]=Bn["[object RegExp]"]=Bn["[object Set]"]=Bn["[object String]"]=Bn["[object WeakMap]"]=false; -var Ln={};Ln["[object Arguments]"]=Ln["[object Array]"]=Ln["[object ArrayBuffer]"]=Ln["[object DataView]"]=Ln["[object Boolean]"]=Ln["[object Date]"]=Ln["[object Float32Array]"]=Ln["[object Float64Array]"]=Ln["[object Int8Array]"]=Ln["[object Int16Array]"]=Ln["[object Int32Array]"]=Ln["[object Map]"]=Ln["[object Number]"]=Ln["[object Object]"]=Ln["[object RegExp]"]=Ln["[object Set]"]=Ln["[object String]"]=Ln["[object Symbol]"]=Ln["[object Uint8Array]"]=Ln["[object Uint8ClampedArray]"]=Ln["[object Uint16Array]"]=Ln["[object Uint32Array]"]=true, -Ln["[object Error]"]=Ln["[object Function]"]=Ln["[object WeakMap]"]=false;var Un={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cn=parseFloat,Dn=parseInt,Mn=typeof global=="object"&&global&&global.Object===Object&&global,Tn=typeof self=="object"&&self&&self.Object===Object&&self,$n=Mn||Tn||Function("return this")(),Fn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Nn=Fn&&typeof module=="object"&&module&&!module.nodeType&&module,Pn=Nn&&Nn.exports===Fn,Zn=Pn&&Mn.process,qn=function(){ -try{var n=Nn&&Nn.f&&Nn.f("util").types;return n?n:Zn&&Zn.binding&&Zn.binding("util")}catch(n){}}(),Vn=qn&&qn.isArrayBuffer,Kn=qn&&qn.isDate,Gn=qn&&qn.isMap,Hn=qn&&qn.isRegExp,Jn=qn&&qn.isSet,Yn=qn&&qn.isTypedArray,Qn=b("length"),Xn=x({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I", -"\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C", -"\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i", -"\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r", -"\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij", -"\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),nt=x({"&":"&","<":"<",">":">",'"':""","'":"'"}),tt=x({"&":"&","<":"<",">":">",""":'"',"'":"'"}),rt=function x(mn){function An(n){if(yu(n)&&!ff(n)&&!(n instanceof Un)){if(n instanceof On)return n;if(oi.call(n,"__wrapped__"))return Fe(n)}return new On(n)}function En(){}function On(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=T}function Un(n){this.__wrapped__=n, -this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Mn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function _t(n,t,e,u,i,o){var f,c=1&t,a=2&t,l=4&t;if(e&&(f=i?e(n,u,i,o):e(n)),f!==T)return f;if(!du(n))return n;if(u=ff(n)){if(f=me(n),!c)return Ur(n,f)}else{var s=vo(n),h="[object Function]"==s||"[object GeneratorFunction]"==s;if(af(n))return Ir(n,c);if("[object Object]"==s||"[object Arguments]"==s||h&&!i){if(f=a||h?{}:Ae(n),!c)return a?Mr(n,lt(f,n)):Dr(n,at(f,n))}else{if(!Ln[s])return i?n:{};f=Ee(n,s,c)}}if(o||(o=new Zn), -i=o.get(n))return i;o.set(n,f),pf(n)?n.forEach(function(r){f.add(_t(r,t,e,r,n,o))}):sf(n)&&n.forEach(function(r,u){f.set(u,_t(r,t,e,u,n,o))});var a=l?a?ve:_e:a?Bu:Wu,p=u?T:a(n);return r(p||n,function(r,u){p&&(u=r,r=n[u]),ot(f,u,_t(r,t,e,u,n,o))}),f}function vt(n){var t=Wu(n);return function(r){return gt(r,n,t)}}function gt(n,t,r){var e=r.length;if(null==n)return!e;for(n=Qu(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===T&&!(u in n)||!i(o))return false}return true}function dt(n,t,r){if(typeof n!="function")throw new ti("Expected a function"); -return bo(function(){n.apply(T,r)},t)}function yt(n,t,r,e){var u=-1,i=o,a=true,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,k(r))),e?(i=f,a=false):200<=t.length&&(i=O,a=false,t=new Nn(t));n:for(;++ut}function Rt(n,t){return null!=n&&oi.call(n,t)}function zt(n,t){return null!=n&&t in Qu(n)}function Wt(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=Ku(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,k(t))),s=Ci(p.length,s), -l[a]=!r&&(t||120<=u&&120<=p.length)?new Nn(a&&p):T}var p=n[0],_=-1,v=l[0];n:for(;++_r.length?t:kt(t,hr(r,0,-1)),r=null==t?t:t[Me(Ve(r))],null==r?T:n(r,t,e)}function Ut(n){return yu(n)&&"[object Arguments]"==Ot(n)}function Ct(n){ -return yu(n)&&"[object ArrayBuffer]"==Ot(n)}function Dt(n){return yu(n)&&"[object Date]"==Ot(n)}function Mt(n,t,r,e,u){if(n===t)t=true;else if(null==n||null==t||!yu(n)&&!yu(t))t=n!==n&&t!==t;else n:{var i=ff(n),o=ff(t),f=i?"[object Array]":vo(n),c=o?"[object Array]":vo(t),f="[object Arguments]"==f?"[object Object]":f,c="[object Arguments]"==c?"[object Object]":c,a="[object Object]"==f,o="[object Object]"==c;if((c=f==c)&&af(n)){if(!af(t)){t=false;break n}i=true,a=false}if(c&&!a)u||(u=new Zn),t=i||_f(n)?se(n,t,r,e,Mt,u):he(n,t,f,r,e,Mt,u);else{ -if(!(1&r)&&(i=a&&oi.call(n,"__wrapped__"),f=o&&oi.call(t,"__wrapped__"),i||f)){n=i?n.value():n,t=f?t.value():t,u||(u=new Zn),t=Mt(n,t,r,e,u);break n}if(c)t:if(u||(u=new Zn),i=1&r,f=_e(n),o=f.length,c=_e(t).length,o==c||i){for(a=o;a--;){var l=f[a];if(!(i?l in t:oi.call(t,l))){t=false;break t}}if((c=u.get(n))&&u.get(t))t=c==t;else{c=true,u.set(n,t),u.set(t,n);for(var s=i;++at?r:0,Se(t,r)?n[t]:T}function Xt(n,t,r){var e=-1;return t=c(t.length?t:[$u],k(ye())),n=Gt(n,function(n){return{ -a:c(t,function(t){return t(n)}),b:++e,c:n}}),w(n,function(n,t){var e;n:{e=-1;for(var u=n.a,i=t.a,o=u.length,f=r.length;++e=f?c:c*("desc"==r[e]?-1:1);break n}}e=n.b-t.b}return e})}function nr(n,t){return tr(n,t,function(t,r){return zu(n,r)})}function tr(n,t,r){for(var e=-1,u=t.length,i={};++et||9007199254740991t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Ku(u);++e=u){for(;e>>1,o=n[i];null!==o&&!wu(o)&&(r?o<=t:ot.length?n:kt(n,hr(t,0,-1)),null==n||delete n[Me(Ve(t))]}function jr(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++ie)return e?br(n[0]):[];for(var u=-1,i=Ku(e);++u=e?n:hr(n,t,r)}function Ir(n,t){if(t)return n.slice();var r=n.length,r=gi?gi(r):new n.constructor(r);return n.copy(r),r}function Rr(n){var t=new n.constructor(n.byteLength);return new vi(t).set(new vi(n)), -t}function zr(n,t){return new n.constructor(t?Rr(n.buffer):n.buffer,n.byteOffset,n.length)}function Wr(n,t){if(n!==t){var r=n!==T,e=null===n,u=n===n,i=wu(n),o=t!==T,f=null===t,c=t===t,a=wu(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&nu?T:i,u=1),t=Qu(t);++eo&&f[0]!==a&&f[o-1]!==a?[]:L(f,a), -o-=c.length,or?r?or(t,n):t:(r=or(t,Oi(n/D(t))),Rn.test(t)?Or(M(r),0,n).join(""):r.slice(0,n))}function te(t,r,e,u){function i(){for(var r=-1,c=arguments.length,a=-1,l=u.length,s=Ku(l+c),h=this&&this!==$n&&this instanceof i?f:t;++at||e)&&(1&n&&(i[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=i[3],i[3]=e?Br(e,r,h[4]):r,i[4]=e?L(i[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=i[5],i[5]=e?Lr(e,r,h[6]):r,i[6]=e?L(i[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(i[7]=r),128&n&&(i[8]=null==i[8]?h[8]:Ci(i[8],h[8])),null==i[9]&&(i[9]=h[9]),i[0]=h[0],i[1]=t),n=i[0], -t=i[1],r=i[2],e=i[3],u=i[4],f=i[9]=i[9]===T?c?0:n.length:Ui(i[9]-a,0),!f&&24&t&&(t&=-25),Ue((h?co:yo)(t&&1!=t?8==t||16==t?Kr(n,t,f):32!=t&&33!=t||u.length?Jr.apply(T,i):te(n,t,r,e):Pr(n,t,r),i),n,t)}function ce(n,t,r,e){return n===T||lu(n,ei[r])&&!oi.call(e,r)?t:n}function ae(n,t,r,e,u,i){return du(n)&&du(t)&&(i.set(t,n),Yt(n,t,T,ae,i),i.delete(t)),n}function le(n){return xu(n)?T:n}function se(n,t,r,e,u,i){var o=1&r,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return false;if((c=i.get(n))&&i.get(t))return c==t; -var c=-1,a=true,l=2&r?new Nn:T;for(i.set(n,t),i.set(t,n);++cr&&(r=Ui(e+r,0)),_(n,ye(t,3),r)):-1}function Pe(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==T&&(u=Eu(r),u=0>r?Ui(e+u,0):Ci(u,e-1)), -_(n,ye(t,3),u,true)}function Ze(n){return(null==n?0:n.length)?wt(n,1):[]}function qe(n){return n&&n.length?n[0]:T}function Ve(n){var t=null==n?0:n.length;return t?n[t-1]:T}function Ke(n,t){return n&&n.length&&t&&t.length?er(n,t):n}function Ge(n){return null==n?n:$i.call(n)}function He(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){if(hu(n))return t=Ui(n.length,t),true}),A(t,function(t){return c(n,b(t))})}function Je(t,r){if(!t||!t.length)return[];var e=He(t);return null==r?e:c(e,function(t){ -return n(r,T,t)})}function Ye(n){return n=An(n),n.__chain__=true,n}function Qe(n,t){return t(n)}function Xe(){return this}function nu(n,t){return(ff(n)?r:uo)(n,ye(t,3))}function tu(n,t){return(ff(n)?e:io)(n,ye(t,3))}function ru(n,t){return(ff(n)?c:Gt)(n,ye(t,3))}function eu(n,t,r){return t=r?T:t,t=n&&null==t?n.length:t,fe(n,128,T,T,T,T,t)}function uu(n,t){var r;if(typeof t!="function")throw new ti("Expected a function");return n=Eu(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=T), -r}}function iu(n,t,r){return t=r?T:t,n=fe(n,8,T,T,T,T,T,t),n.placeholder=iu.placeholder,n}function ou(n,t,r){return t=r?T:t,n=fe(n,16,T,T,T,T,T,t),n.placeholder=ou.placeholder,n}function fu(n,t,r){function e(t){var r=c,e=a;return c=a=T,_=t,s=n.apply(e,r)}function u(n){var r=n-p;return n-=_,p===T||r>=t||0>r||g&&n>=l}function i(){var n=Go();if(u(n))return o(n);var r,e=bo;r=n-_,n=t-(n-p),r=g?Ci(n,l-r):n,h=e(i,r)}function o(n){return h=T,d&&c?e(n):(c=a=T,s)}function f(){var n=Go(),r=u(n);if(c=arguments, -a=this,p=n,r){if(h===T)return _=n=p,h=bo(i,t),v?e(n):s;if(g)return lo(h),h=bo(i,t),e(p)}return h===T&&(h=bo(i,t)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof n!="function")throw new ti("Expected a function");return t=Su(t)||0,du(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Ui(Su(r.maxWait)||0,t):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==T&&lo(h),_=0,c=p=a=h=T},f.flush=function(){return h===T?s:o(Go())},f}function cu(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache; -return i.has(u)?i.get(u):(e=n.apply(this,e),r.cache=i.set(u,e)||i,e)}if(typeof n!="function"||null!=t&&typeof t!="function")throw new ti("Expected a function");return r.cache=new(cu.Cache||Fn),r}function au(n){if(typeof n!="function")throw new ti("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function lu(n,t){return n===t||n!==n&&t!==t; -}function su(n){return null!=n&&gu(n.length)&&!_u(n)}function hu(n){return yu(n)&&su(n)}function pu(n){if(!yu(n))return false;var t=Ot(n);return"[object Error]"==t||"[object DOMException]"==t||typeof n.message=="string"&&typeof n.name=="string"&&!xu(n)}function _u(n){return!!du(n)&&(n=Ot(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function vu(n){return typeof n=="number"&&n==Eu(n)}function gu(n){return typeof n=="number"&&-1=n; -}function du(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function yu(n){return null!=n&&typeof n=="object"}function bu(n){return typeof n=="number"||yu(n)&&"[object Number]"==Ot(n)}function xu(n){return!(!yu(n)||"[object Object]"!=Ot(n))&&(n=di(n),null===n||(n=oi.call(n,"constructor")&&n.constructor,typeof n=="function"&&n instanceof n&&ii.call(n)==li))}function ju(n){return typeof n=="string"||!ff(n)&&yu(n)&&"[object String]"==Ot(n)}function wu(n){return typeof n=="symbol"||yu(n)&&"[object Symbol]"==Ot(n); -}function mu(n){if(!n)return[];if(su(n))return ju(n)?M(n):Ur(n);if(wi&&n[wi]){n=n[wi]();for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}return t=vo(n),("[object Map]"==t?W:"[object Set]"==t?U:Uu)(n)}function Au(n){return n?(n=Su(n),n===$||n===-$?1.7976931348623157e308*(0>n?-1:1):n===n?n:0):0===n?n:0}function Eu(n){n=Au(n);var t=n%1;return n===n?t?n-t:n:0}function ku(n){return n?pt(Eu(n),0,4294967295):0}function Su(n){if(typeof n=="number")return n;if(wu(n))return F;if(du(n)&&(n=typeof n.valueOf=="function"?n.valueOf():n, -n=du(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(un,"");var t=gn.test(n);return t||yn.test(n)?Dn(n.slice(2),t?2:8):vn.test(n)?F:+n}function Ou(n){return Cr(n,Bu(n))}function Iu(n){return null==n?"":yr(n)}function Ru(n,t,r){return n=null==n?T:kt(n,t),n===T?r:n}function zu(n,t){return null!=n&&we(n,t,zt)}function Wu(n){return su(n)?qn(n):Vt(n)}function Bu(n){if(su(n))n=qn(n,true);else if(du(n)){var t,r=ze(n),e=[];for(t in n)("constructor"!=t||!r&&oi.call(n,t))&&e.push(t);n=e}else{if(t=[], -null!=n)for(r in Qu(n))t.push(r);n=t}return n}function Lu(n,t){if(null==n)return{};var r=c(ve(n),function(n){return[n]});return t=ye(t),tr(n,r,function(n,r){return t(n,r[0])})}function Uu(n){return null==n?[]:S(n,Wu(n))}function Cu(n){return $f(Iu(n).toLowerCase())}function Du(n){return(n=Iu(n))&&n.replace(xn,Xn).replace(Sn,"")}function Mu(n,t,r){return n=Iu(n),t=r?T:t,t===T?zn.test(n)?n.match(In)||[]:n.match(sn)||[]:n.match(t)||[]}function Tu(n){return function(){return n}}function $u(n){return n; -}function Fu(n){return qt(typeof n=="function"?n:_t(n,1))}function Nu(n,t,e){var u=Wu(t),i=Et(t,u);null!=e||du(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=Et(t,Wu(t)));var o=!(du(e)&&"chain"in e&&!e.chain),f=_u(n);return r(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Ur(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function Pu(){} -function Zu(n){return Ie(n)?b(Me(n)):rr(n)}function qu(){return[]}function Vu(){return false}mn=null==mn?$n:rt.defaults($n.Object(),mn,rt.pick($n,Wn));var Ku=mn.Array,Gu=mn.Date,Hu=mn.Error,Ju=mn.Function,Yu=mn.Math,Qu=mn.Object,Xu=mn.RegExp,ni=mn.String,ti=mn.TypeError,ri=Ku.prototype,ei=Qu.prototype,ui=mn["__core-js_shared__"],ii=Ju.prototype.toString,oi=ei.hasOwnProperty,fi=0,ci=function(){var n=/[^.]+$/.exec(ui&&ui.keys&&ui.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),ai=ei.toString,li=ii.call(Qu),si=$n._,hi=Xu("^"+ii.call(oi).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pi=Pn?mn.Buffer:T,_i=mn.Symbol,vi=mn.Uint8Array,gi=pi?pi.g:T,di=B(Qu.getPrototypeOf,Qu),yi=Qu.create,bi=ei.propertyIsEnumerable,xi=ri.splice,ji=_i?_i.isConcatSpreadable:T,wi=_i?_i.iterator:T,mi=_i?_i.toStringTag:T,Ai=function(){ -try{var n=je(Qu,"defineProperty");return n({},"",{}),n}catch(n){}}(),Ei=mn.clearTimeout!==$n.clearTimeout&&mn.clearTimeout,ki=Gu&&Gu.now!==$n.Date.now&&Gu.now,Si=mn.setTimeout!==$n.setTimeout&&mn.setTimeout,Oi=Yu.ceil,Ii=Yu.floor,Ri=Qu.getOwnPropertySymbols,zi=pi?pi.isBuffer:T,Wi=mn.isFinite,Bi=ri.join,Li=B(Qu.keys,Qu),Ui=Yu.max,Ci=Yu.min,Di=Gu.now,Mi=mn.parseInt,Ti=Yu.random,$i=ri.reverse,Fi=je(mn,"DataView"),Ni=je(mn,"Map"),Pi=je(mn,"Promise"),Zi=je(mn,"Set"),qi=je(mn,"WeakMap"),Vi=je(Qu,"create"),Ki=qi&&new qi,Gi={},Hi=Te(Fi),Ji=Te(Ni),Yi=Te(Pi),Qi=Te(Zi),Xi=Te(qi),no=_i?_i.prototype:T,to=no?no.valueOf:T,ro=no?no.toString:T,eo=function(){ -function n(){}return function(t){return du(t)?yi?yi(t):(n.prototype=t,t=new n,n.prototype=T,t):{}}}();An.templateSettings={escape:J,evaluate:Y,interpolate:Q,variable:"",imports:{_:An}},An.prototype=En.prototype,An.prototype.constructor=An,On.prototype=eo(En.prototype),On.prototype.constructor=On,Un.prototype=eo(En.prototype),Un.prototype.constructor=Un,Mn.prototype.clear=function(){this.__data__=Vi?Vi(null):{},this.size=0},Mn.prototype.delete=function(n){return n=this.has(n)&&delete this.__data__[n], -this.size-=n?1:0,n},Mn.prototype.get=function(n){var t=this.__data__;return Vi?(n=t[n],"__lodash_hash_undefined__"===n?T:n):oi.call(t,n)?t[n]:T},Mn.prototype.has=function(n){var t=this.__data__;return Vi?t[n]!==T:oi.call(t,n)},Mn.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=Vi&&t===T?"__lodash_hash_undefined__":t,this},Tn.prototype.clear=function(){this.__data__=[],this.size=0},Tn.prototype.delete=function(n){var t=this.__data__;return n=ft(t,n),!(0>n)&&(n==t.length-1?t.pop():xi.call(t,n,1), ---this.size,true)},Tn.prototype.get=function(n){var t=this.__data__;return n=ft(t,n),0>n?T:t[n][1]},Tn.prototype.has=function(n){return-1e?(++this.size,r.push([n,t])):r[e][1]=t,this},Fn.prototype.clear=function(){this.size=0,this.__data__={hash:new Mn,map:new(Ni||Tn),string:new Mn}},Fn.prototype.delete=function(n){return n=be(this,n).delete(n),this.size-=n?1:0,n},Fn.prototype.get=function(n){return be(this,n).get(n); -},Fn.prototype.has=function(n){return be(this,n).has(n)},Fn.prototype.set=function(n,t){var r=be(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},Nn.prototype.add=Nn.prototype.push=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},Nn.prototype.has=function(n){return this.__data__.has(n)},Zn.prototype.clear=function(){this.__data__=new Tn,this.size=0},Zn.prototype.delete=function(n){var t=this.__data__;return n=t.delete(n),this.size=t.size,n},Zn.prototype.get=function(n){ -return this.__data__.get(n)},Zn.prototype.has=function(n){return this.__data__.has(n)},Zn.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Tn){var e=r.__data__;if(!Ni||199>e.length)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Fn(e)}return r.set(n,t),this.size=r.size,this};var uo=Fr(mt),io=Fr(At,true),oo=Nr(),fo=Nr(true),co=Ki?function(n,t){return Ki.set(n,t),n}:$u,ao=Ai?function(n,t){return Ai(n,"toString",{configurable:true,enumerable:false,value:Tu(t),writable:true})}:$u,lo=Ei||function(n){ -return $n.clearTimeout(n)},so=Zi&&1/U(new Zi([,-0]))[1]==$?function(n){return new Zi(n)}:Pu,ho=Ki?function(n){return Ki.get(n)}:Pu,po=Ri?function(n){return null==n?[]:(n=Qu(n),i(Ri(n),function(t){return bi.call(n,t)}))}:qu,_o=Ri?function(n){for(var t=[];n;)a(t,po(n)),n=di(n);return t}:qu,vo=Ot;(Fi&&"[object DataView]"!=vo(new Fi(new ArrayBuffer(1)))||Ni&&"[object Map]"!=vo(new Ni)||Pi&&"[object Promise]"!=vo(Pi.resolve())||Zi&&"[object Set]"!=vo(new Zi)||qi&&"[object WeakMap]"!=vo(new qi))&&(vo=function(n){ -var t=Ot(n);if(n=(n="[object Object]"==t?n.constructor:T)?Te(n):"")switch(n){case Hi:return"[object DataView]";case Ji:return"[object Map]";case Yi:return"[object Promise]";case Qi:return"[object Set]";case Xi:return"[object WeakMap]"}return t});var go=ui?_u:Vu,yo=Ce(co),bo=Si||function(n,t){return $n.setTimeout(n,t)},xo=Ce(ao),jo=function(n){n=cu(n,function(n){return 500===t.size&&t.clear(),n});var t=n.cache;return n}(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(tn,function(n,r,e,u){ -t.push(e?u.replace(hn,"$1"):r||n)}),t}),wo=fr(function(n,t){return hu(n)?yt(n,wt(t,1,hu,true)):[]}),mo=fr(function(n,t){var r=Ve(t);return hu(r)&&(r=T),hu(n)?yt(n,wt(t,1,hu,true),ye(r,2)):[]}),Ao=fr(function(n,t){var r=Ve(t);return hu(r)&&(r=T),hu(n)?yt(n,wt(t,1,hu,true),T,r):[]}),Eo=fr(function(n){var t=c(n,Er);return t.length&&t[0]===n[0]?Wt(t):[]}),ko=fr(function(n){var t=Ve(n),r=c(n,Er);return t===Ve(r)?t=T:r.pop(),r.length&&r[0]===n[0]?Wt(r,ye(t,2)):[]}),So=fr(function(n){var t=Ve(n),r=c(n,Er);return(t=typeof t=="function"?t:T)&&r.pop(), -r.length&&r[0]===n[0]?Wt(r,T,t):[]}),Oo=fr(Ke),Io=pe(function(n,t){var r=null==n?0:n.length,e=ht(n,t);return ur(n,c(t,function(n){return Se(n,r)?+n:n}).sort(Wr)),e}),Ro=fr(function(n){return br(wt(n,1,hu,true))}),zo=fr(function(n){var t=Ve(n);return hu(t)&&(t=T),br(wt(n,1,hu,true),ye(t,2))}),Wo=fr(function(n){var t=Ve(n),t=typeof t=="function"?t:T;return br(wt(n,1,hu,true),T,t)}),Bo=fr(function(n,t){return hu(n)?yt(n,t):[]}),Lo=fr(function(n){return mr(i(n,hu))}),Uo=fr(function(n){var t=Ve(n);return hu(t)&&(t=T), -mr(i(n,hu),ye(t,2))}),Co=fr(function(n){var t=Ve(n),t=typeof t=="function"?t:T;return mr(i(n,hu),T,t)}),Do=fr(He),Mo=fr(function(n){var t=n.length,t=1=t}),of=Ut(function(){return arguments}())?Ut:function(n){return yu(n)&&oi.call(n,"callee")&&!bi.call(n,"callee")},ff=Ku.isArray,cf=Vn?k(Vn):Ct,af=zi||Vu,lf=Kn?k(Kn):Dt,sf=Gn?k(Gn):Tt,hf=Hn?k(Hn):Nt,pf=Jn?k(Jn):Pt,_f=Yn?k(Yn):Zt,vf=ee(Kt),gf=ee(function(n,t){return n<=t}),df=$r(function(n,t){ -if(ze(t)||su(t))Cr(t,Wu(t),n);else for(var r in t)oi.call(t,r)&&ot(n,r,t[r])}),yf=$r(function(n,t){Cr(t,Bu(t),n)}),bf=$r(function(n,t,r,e){Cr(t,Bu(t),n,e)}),xf=$r(function(n,t,r,e){Cr(t,Wu(t),n,e)}),jf=pe(ht),wf=fr(function(n,t){n=Qu(n);var r=-1,e=t.length,u=2--n)return t.apply(this,arguments)}},An.ary=eu,An.assign=df,An.assignIn=yf,An.assignInWith=bf,An.assignWith=xf,An.at=jf,An.before=uu,An.bind=Ho,An.bindAll=Nf,An.bindKey=Jo,An.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return ff(n)?n:[n]},An.chain=Ye,An.chunk=function(n,t,r){if(t=(r?Oe(n,t,r):t===T)?1:Ui(Eu(t),0),r=null==n?0:n.length,!r||1>t)return[];for(var e=0,u=0,i=Ku(Oi(r/t));et?0:t,e)):[]},An.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:Eu(t),t=e-t,hr(n,0,0>t?0:t)):[]},An.dropRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true,true):[]; -},An.dropWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true):[]},An.fill=function(n,t,r,e){var u=null==n?0:n.length;if(!u)return[];for(r&&typeof r!="number"&&Oe(n,t,r)&&(r=0,e=u),u=n.length,r=Eu(r),0>r&&(r=-r>u?0:u+r),e=e===T||e>u?u:Eu(e),0>e&&(e+=u),e=r>e?0:ku(e);r>>0,r?(n=Iu(n))&&(typeof t=="string"||null!=t&&!hf(t))&&(t=yr(t),!t&&Rn.test(n))?Or(M(n),0,r):n.split(t,r):[]},An.spread=function(t,r){if(typeof t!="function")throw new ti("Expected a function");return r=null==r?0:Ui(Eu(r),0), -fr(function(e){var u=e[r];return e=Or(e,0,r),u&&a(e,u),n(t,this,e)})},An.tail=function(n){var t=null==n?0:n.length;return t?hr(n,1,t):[]},An.take=function(n,t,r){return n&&n.length?(t=r||t===T?1:Eu(t),hr(n,0,0>t?0:t)):[]},An.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:Eu(t),t=e-t,hr(n,0>t?0:t,e)):[]},An.takeRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),false,true):[]},An.takeWhile=function(n,t){return n&&n.length?jr(n,ye(t,3)):[]},An.tap=function(n,t){return t(n), -n},An.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ti("Expected a function");return du(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),fu(n,t,{leading:e,maxWait:t,trailing:u})},An.thru=Qe,An.toArray=mu,An.toPairs=zf,An.toPairsIn=Wf,An.toPath=function(n){return ff(n)?c(n,Me):wu(n)?[n]:Ur(jo(Iu(n)))},An.toPlainObject=Ou,An.transform=function(n,t,e){var u=ff(n),i=u||af(n)||_f(n);if(t=ye(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:du(n)&&_u(o)?eo(di(n)):{}; -}return(i?r:mt)(n,function(n,r,u){return t(e,n,r,u)}),e},An.unary=function(n){return eu(n,1)},An.union=Ro,An.unionBy=zo,An.unionWith=Wo,An.uniq=function(n){return n&&n.length?br(n):[]},An.uniqBy=function(n,t){return n&&n.length?br(n,ye(t,2)):[]},An.uniqWith=function(n,t){return t=typeof t=="function"?t:T,n&&n.length?br(n,T,t):[]},An.unset=function(n,t){return null==n||xr(n,t)},An.unzip=He,An.unzipWith=Je,An.update=function(n,t,r){return null==n?n:lr(n,t,kr(r)(kt(n,t)),void 0)},An.updateWith=function(n,t,r,e){ -return e=typeof e=="function"?e:T,null!=n&&(n=lr(n,t,kr(r)(kt(n,t)),e)),n},An.values=Uu,An.valuesIn=function(n){return null==n?[]:S(n,Bu(n))},An.without=Bo,An.words=Mu,An.wrap=function(n,t){return nf(kr(t),n)},An.xor=Lo,An.xorBy=Uo,An.xorWith=Co,An.zip=Do,An.zipObject=function(n,t){return Ar(n||[],t||[],ot)},An.zipObjectDeep=function(n,t){return Ar(n||[],t||[],lr)},An.zipWith=Mo,An.entries=zf,An.entriesIn=Wf,An.extend=yf,An.extendWith=bf,Nu(An,An),An.add=Qf,An.attempt=Ff,An.camelCase=Bf,An.capitalize=Cu, -An.ceil=Xf,An.clamp=function(n,t,r){return r===T&&(r=t,t=T),r!==T&&(r=Su(r),r=r===r?r:0),t!==T&&(t=Su(t),t=t===t?t:0),pt(Su(n),t,r)},An.clone=function(n){return _t(n,4)},An.cloneDeep=function(n){return _t(n,5)},An.cloneDeepWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,5,t)},An.cloneWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,4,t)},An.conformsTo=function(n,t){return null==t||gt(n,t,Wu(t))},An.deburr=Du,An.defaultTo=function(n,t){return null==n||n!==n?t:n},An.divide=nc,An.endsWith=function(n,t,r){ -n=Iu(n),t=yr(t);var e=n.length,e=r=r===T?e:pt(Eu(r),0,e);return r-=t.length,0<=r&&n.slice(r,e)==t},An.eq=lu,An.escape=function(n){return(n=Iu(n))&&H.test(n)?n.replace(K,nt):n},An.escapeRegExp=function(n){return(n=Iu(n))&&en.test(n)?n.replace(rn,"\\$&"):n},An.every=function(n,t,r){var e=ff(n)?u:bt;return r&&Oe(n,t,r)&&(t=T),e(n,ye(t,3))},An.find=Fo,An.findIndex=Ne,An.findKey=function(n,t){return p(n,ye(t,3),mt)},An.findLast=No,An.findLastIndex=Pe,An.findLastKey=function(n,t){return p(n,ye(t,3),At); -},An.floor=tc,An.forEach=nu,An.forEachRight=tu,An.forIn=function(n,t){return null==n?n:oo(n,ye(t,3),Bu)},An.forInRight=function(n,t){return null==n?n:fo(n,ye(t,3),Bu)},An.forOwn=function(n,t){return n&&mt(n,ye(t,3))},An.forOwnRight=function(n,t){return n&&At(n,ye(t,3))},An.get=Ru,An.gt=ef,An.gte=uf,An.has=function(n,t){return null!=n&&we(n,t,Rt)},An.hasIn=zu,An.head=qe,An.identity=$u,An.includes=function(n,t,r,e){return n=su(n)?n:Uu(n),r=r&&!e?Eu(r):0,e=n.length,0>r&&(r=Ui(e+r,0)),ju(n)?r<=e&&-1r&&(r=Ui(e+r,0)),v(n,t,r)):-1},An.inRange=function(n,t,r){return t=Au(t),r===T?(r=t,t=0):r=Au(r),n=Su(n),n>=Ci(t,r)&&n=n},An.isSet=pf,An.isString=ju,An.isSymbol=wu,An.isTypedArray=_f,An.isUndefined=function(n){return n===T},An.isWeakMap=function(n){return yu(n)&&"[object WeakMap]"==vo(n)},An.isWeakSet=function(n){return yu(n)&&"[object WeakSet]"==Ot(n)},An.join=function(n,t){return null==n?"":Bi.call(n,t)},An.kebabCase=Lf,An.last=Ve,An.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;if(r!==T&&(u=Eu(r),u=0>u?Ui(e+u,0):Ci(u,e-1)), -t===t){for(r=u+1;r--&&n[r]!==t;);n=r}else n=_(n,d,u,true);return n},An.lowerCase=Uf,An.lowerFirst=Cf,An.lt=vf,An.lte=gf,An.max=function(n){return n&&n.length?xt(n,$u,It):T},An.maxBy=function(n,t){return n&&n.length?xt(n,ye(t,2),It):T},An.mean=function(n){return y(n,$u)},An.meanBy=function(n,t){return y(n,ye(t,2))},An.min=function(n){return n&&n.length?xt(n,$u,Kt):T},An.minBy=function(n,t){return n&&n.length?xt(n,ye(t,2),Kt):T},An.stubArray=qu,An.stubFalse=Vu,An.stubObject=function(){return{}},An.stubString=function(){ -return""},An.stubTrue=function(){return true},An.multiply=rc,An.nth=function(n,t){return n&&n.length?Qt(n,Eu(t)):T},An.noConflict=function(){return $n._===this&&($n._=si),this},An.noop=Pu,An.now=Go,An.pad=function(n,t,r){n=Iu(n);var e=(t=Eu(t))?D(n):0;return!t||e>=t?n:(t=(t-e)/2,ne(Ii(t),r)+n+ne(Oi(t),r))},An.padEnd=function(n,t,r){n=Iu(n);var e=(t=Eu(t))?D(n):0;return t&&et){var e=n;n=t,t=e}return r||n%1||t%1?(r=Ti(),Ci(n+r*(t-n+Cn("1e-"+((r+"").length-1))),t)):ir(n,t)},An.reduce=function(n,t,r){var e=ff(n)?l:j,u=3>arguments.length;return e(n,ye(t,4),r,u,uo)},An.reduceRight=function(n,t,r){var e=ff(n)?s:j,u=3>arguments.length; -return e(n,ye(t,4),r,u,io)},An.repeat=function(n,t,r){return t=(r?Oe(n,t,r):t===T)?1:Eu(t),or(Iu(n),t)},An.replace=function(){var n=arguments,t=Iu(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},An.result=function(n,t,r){t=Sr(t,n);var e=-1,u=t.length;for(u||(u=1,n=T);++en||9007199254740991=i)return n;if(i=r-D(e),1>i)return e;if(r=o?Or(o,0,i).join(""):n.slice(0,i),u===T)return r+e;if(o&&(i+=r.length-i),hf(u)){if(n.slice(i).search(u)){ -var f=r;for(u.global||(u=Xu(u.source,Iu(_n.exec(u))+"g")),u.lastIndex=0;o=u.exec(f);)var c=o.index;r=r.slice(0,c===T?i:c)}}else n.indexOf(yr(u),i)!=i&&(u=r.lastIndexOf(u),-1e.__dir__?"Right":"")}),e},Un.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){ -var r=t+1,e=1==r||3==r;Un.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:ye(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){var r="take"+(t?"Right":"");Un.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Un.prototype[n]=function(){return this.__filtered__?new Un(this):this[r](1)}}),Un.prototype.compact=function(){return this.filter($u)},Un.prototype.find=function(n){ -return this.filter(n).head()},Un.prototype.findLast=function(n){return this.reverse().find(n)},Un.prototype.invokeMap=fr(function(n,t){return typeof n=="function"?new Un(this):this.map(function(r){return Lt(r,n,t)})}),Un.prototype.reject=function(n){return this.filter(au(ye(n)))},Un.prototype.slice=function(n,t){n=Eu(n);var r=this;return r.__filtered__&&(0t)?new Un(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==T&&(t=Eu(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},Un.prototype.takeRightWhile=function(n){ -return this.reverse().takeWhile(n).reverse()},Un.prototype.toArray=function(){return this.take(4294967295)},mt(Un.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=An[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(An.prototype[t]=function(){function t(n){return n=u.apply(An,a([n],f)),e&&h?n[0]:n}var o=this.__wrapped__,f=e?[1]:arguments,c=o instanceof Un,l=f[0],s=c||ff(o);s&&r&&typeof l=="function"&&1!=l.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,l=i&&!h,c=c&&!p; -return!i&&s?(o=c?o:new Un(this),o=n.apply(o,f),o.__actions__.push({func:Qe,args:[t],thisArg:T}),new On(o,h)):l&&c?n.apply(this,f):(o=this.thru(t),l?e?o.value()[0]:o.value():o)})}),r("pop push shift sort splice unshift".split(" "),function(n){var t=ri[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);An.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(ff(u)?u:[],n)}return this[r](function(r){return t.apply(ff(r)?r:[],n)}); -}}),mt(Un.prototype,function(n,t){var r=An[t];if(r){var e=r.name+"";oi.call(Gi,e)||(Gi[e]=[]),Gi[e].push({name:t,func:r})}}),Gi[Jr(T,2).name]=[{name:"wrapper",func:T}],Un.prototype.clone=function(){var n=new Un(this.__wrapped__);return n.__actions__=Ur(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Ur(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Ur(this.__views__),n},Un.prototype.reverse=function(){if(this.__filtered__){var n=new Un(this); -n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},Un.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=ff(t),u=0>r,i=e?t.length:0;n=i;for(var o=this.__views__,f=0,c=-1,a=o.length;++c=this.__values__.length;return{done:n,value:n?T:this.__values__[this.__index__++]}},An.prototype.plant=function(n){ -for(var t,r=this;r instanceof En;){var e=Fe(r);e.__index__=0,e.__values__=T,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},An.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Un?(this.__actions__.length&&(n=new Un(this)),n=n.reverse(),n.__actions__.push({func:Qe,args:[Ge],thisArg:T}),new On(n,this.__chain__)):this.thru(Ge)},An.prototype.toJSON=An.prototype.valueOf=An.prototype.value=function(){return wr(this.__wrapped__,this.__actions__)},An.prototype.first=An.prototype.head, -wi&&(An.prototype[wi]=Xe),An}();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($n._=rt, define(function(){return rt})):Nn?((Nn.exports=rt)._=rt,Fn._=rt):$n._=rt}).call(this); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/package.json b/tools/node_modules/babel-eslint/node_modules/lodash/package.json deleted file mode 100644 index ccf80be0796354..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/lodash/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be" - } - ], - "deprecated": false, - "description": "Lodash modular utilities.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "modules", - "stdlib", - "util" - ], - "license": "MIT", - "main": "lodash.js", - "name": "lodash", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\"" - }, - "version": "4.17.15" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/index.js b/tools/node_modules/babel-eslint/node_modules/resolve/index.js deleted file mode 100644 index eb6ba89e6c210c..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/resolve/index.js +++ /dev/null @@ -1,8 +0,0 @@ -var core = require('./lib/core'); -var async = require('./lib/async'); -async.core = core; -async.isCore = function isCore(x) { return core[x]; }; -async.sync = require('./lib/sync'); - -exports = async; -module.exports = async; diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/package.json b/tools/node_modules/babel-eslint/node_modules/resolve/package.json deleted file mode 100644 index 95353241e58cad..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/resolve/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/browserify/resolve/issues" - }, - "bundleDependencies": false, - "dependencies": { - "path-parse": "^1.0.6" - }, - "deprecated": false, - "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", - "devDependencies": { - "@ljharb/eslint-config": "^13.1.1", - "eslint": "^5.16.0", - "object-keys": "^1.1.1", - "safe-publish-latest": "^1.1.2", - "tap": "0.4.13", - "tape": "^4.11.0" - }, - "homepage": "https://github.com/browserify/resolve#readme", - "keywords": [ - "resolve", - "require", - "node", - "module" - ], - "license": "MIT", - "main": "index.js", - "name": "resolve", - "repository": { - "type": "git", - "url": "git://github.com/browserify/resolve.git" - }, - "scripts": { - "lint": "eslint .", - "posttest": "npm run test:multirepo", - "prepublish": "safe-publish-latest", - "pretest": "npm run lint", - "pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async", - "test": "npm run --silent tests-only", - "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test", - "tests-only": "tape test/*.js" - }, - "version": "1.12.0" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/package.json b/tools/node_modules/babel-eslint/node_modules/source-map/package.json deleted file mode 100644 index 9e2674cec8bd3c..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/source-map/package.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "author": { - "name": "Nick Fitzgerald", - "email": "nfitzgerald@mozilla.com" - }, - "bugs": { - "url": "https://github.com/mozilla/source-map/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Tobias Koppers", - "email": "tobias.koppers@googlemail.com" - }, - { - "name": "Duncan Beevers", - "email": "duncan@dweebd.com" - }, - { - "name": "Stephen Crane", - "email": "scrane@mozilla.com" - }, - { - "name": "Ryan Seddon", - "email": "seddon.ryan@gmail.com" - }, - { - "name": "Miles Elam", - "email": "miles.elam@deem.com" - }, - { - "name": "Mihai Bazon", - "email": "mihai.bazon@gmail.com" - }, - { - "name": "Michael Ficarra", - "email": "github.public.email@michael.ficarra.me" - }, - { - "name": "Todd Wolfson", - "email": "todd@twolfson.com" - }, - { - "name": "Alexander Solovyov", - "email": "alexander@solovyov.net" - }, - { - "name": "Felix Gnass", - "email": "fgnass@gmail.com" - }, - { - "name": "Conrad Irwin", - "email": "conrad.irwin@gmail.com" - }, - { - "name": "usrbincc", - "email": "usrbincc@yahoo.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Chase Douglas", - "email": "chase@newrelic.com" - }, - { - "name": "Evan Wallace", - "email": "evan.exe@gmail.com" - }, - { - "name": "Heather Arthur", - "email": "fayearthur@gmail.com" - }, - { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Simon Lydell", - "email": "simon.lydell@gmail.com" - }, - { - "name": "Jmeas Smith", - "email": "jellyes2@gmail.com" - }, - { - "name": "Michael Z Goddard", - "email": "mzgoddard@gmail.com" - }, - { - "name": "azu", - "email": "azu@users.noreply.github.com" - }, - { - "name": "John Gozde", - "email": "john@gozde.ca" - }, - { - "name": "Adam Kirkton", - "email": "akirkton@truefitinnovation.com" - }, - { - "name": "Chris Montgomery", - "email": "christopher.montgomery@dowjones.com" - }, - { - "name": "J. Ryan Stinnett", - "email": "jryans@gmail.com" - }, - { - "name": "Jack Herrington", - "email": "jherrington@walmartlabs.com" - }, - { - "name": "Chris Truter", - "email": "jeffpalentine@gmail.com" - }, - { - "name": "Daniel Espeset", - "email": "daniel@danielespeset.com" - }, - { - "name": "Jamie Wong", - "email": "jamie.lf.wong@gmail.com" - }, - { - "name": "Eddy Bruël", - "email": "ejpbruel@mozilla.com" - }, - { - "name": "Hawken Rives", - "email": "hawkrives@gmail.com" - }, - { - "name": "Gilad Peleg", - "email": "giladp007@gmail.com" - }, - { - "name": "djchie", - "email": "djchie.dev@gmail.com" - }, - { - "name": "Gary Ye", - "email": "garysye@gmail.com" - }, - { - "name": "Nicolas Lalevée", - "email": "nicolas.lalevee@hibnet.org" - } - ], - "deprecated": false, - "description": "Generates and consumes source maps", - "devDependencies": { - "doctoc": "^0.15.0", - "webpack": "^1.12.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "source-map.js", - "lib/", - "dist/source-map.debug.js", - "dist/source-map.js", - "dist/source-map.min.js", - "dist/source-map.min.js.map" - ], - "homepage": "https://github.com/mozilla/source-map", - "license": "BSD-3-Clause", - "main": "./source-map.js", - "name": "source-map", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/mozilla/source-map.git" - }, - "scripts": { - "build": "webpack --color", - "test": "npm run build && node test/run-tests.js", - "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" - }, - "typings": "source-map", - "version": "0.5.7" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/supports-color/package.json b/tools/node_modules/babel-eslint/node_modules/supports-color/package.json deleted file mode 100644 index 9e4eafa8573232..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/supports-color/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/chalk/supports-color/issues" - }, - "bundleDependencies": false, - "dependencies": { - "has-flag": "^3.0.0" - }, - "deprecated": false, - "description": "Detect whether a terminal supports color", - "devDependencies": { - "ava": "^0.25.0", - "import-fresh": "^2.0.0", - "xo": "^0.20.0" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "browser.js" - ], - "homepage": "https://github.com/chalk/supports-color#readme", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "license": "MIT", - "name": "supports-color", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/supports-color.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "5.5.0" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/trim-right/index.js b/tools/node_modules/babel-eslint/node_modules/trim-right/index.js deleted file mode 100644 index 666f4b2f4eeb6a..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/trim-right/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -module.exports = function (str) { - var tail = str.length; - - while (/[\s\uFEFF\u00A0]/.test(str[tail - 1])) { - tail--; - } - - return str.slice(0, tail); -}; diff --git a/tools/node_modules/babel-eslint/node_modules/trim-right/package.json b/tools/node_modules/babel-eslint/node_modules/trim-right/package.json deleted file mode 100644 index 4ed056783bb584..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/trim-right/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/trim-right/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Similar to String#trim() but removes only whitespace on the right", - "devDependencies": { - "ava": "0.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/trim-right#readme", - "keywords": [ - "trim", - "right", - "string", - "str", - "util", - "utils", - "utility", - "whitespace", - "space", - "remove", - "delete" - ], - "license": "MIT", - "name": "trim-right", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/trim-right.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.1" -} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/trim-right/readme.md b/tools/node_modules/babel-eslint/node_modules/trim-right/readme.md deleted file mode 100644 index 0a4438acd7a898..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/trim-right/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# trim-right [![Build Status](https://travis-ci.org/sindresorhus/trim-right.svg?branch=master)](https://travis-ci.org/sindresorhus/trim-right) - -> Similar to [`String#trim()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) but removes only whitespace on the right - - -## Install - -``` -$ npm install --save trim-right -``` - - -## Usage - -```js -var trimRight = require('trim-right'); - -trimRight(' unicorn '); -//=> ' unicorn' -``` - - -## Related - -- [`trim-left`](https://github.com/sindresorhus/trim-left) - Similar to `String#trim()` but removes only whitespace on the left - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/node_modules/babel-eslint/package.json b/tools/node_modules/babel-eslint/package.json deleted file mode 100644 index fae7c72dbbf113..00000000000000 --- a/tools/node_modules/babel-eslint/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bugs": { - "url": "https://github.com/babel/babel-eslint/issues" - }, - "bundleDependencies": false, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.0.0", - "@babel/traverse": "^7.0.0", - "@babel/types": "^7.0.0", - "eslint-visitor-keys": "^1.0.0", - "resolve": "^1.12.0" - }, - "deprecated": false, - "description": "Custom parser for ESLint", - "devDependencies": { - "babel-eslint": "^8.2.6", - "dedent": "^0.7.0", - "eslint": "^5.6.0", - "eslint-config-babel": "^7.0.1", - "eslint-plugin-flowtype": "^2.30.3", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-prettier": "^2.1.2", - "espree": "^3.5.2", - "husky": "^1.0.0-rc.13", - "lint-staged": "^7.2.2", - "mocha": "^5.0.1", - "prettier": "^1.4.4" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/babel/babel-eslint", - "license": "MIT", - "lint-staged": { - "*.js": [ - "eslint --format=codeframe --fix", - "git add" - ] - }, - "main": "lib/index.js", - "name": "babel-eslint", - "peerDependencies": { - "eslint": ">= 4.12.1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel-eslint.git" - }, - "scripts": { - "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'", - "fix": "eslint lib test --fix", - "lint": "eslint lib test", - "precommit": "lint-staged", - "preversion": "npm test", - "test": "npm run lint && npm run test-only", - "test-only": "mocha && mocha --require test/fixtures/preprocess-to-patch.js" - }, - "version": "10.0.3" -} \ No newline at end of file diff --git a/tools/update-babel-eslint.sh b/tools/update-babel-eslint.sh index 700194da937dcb..d6de6d25e1d212 100755 --- a/tools/update-babel-eslint.sh +++ b/tools/update-babel-eslint.sh @@ -1,19 +1,19 @@ -#!/usr/bin/env bash +#!/bin/sh # Shell script to update babel-eslint in the source tree to the latest release. # Depends on npm, npx, and node being in $PATH. # This script must be be in the tools directory when it runs because it uses -# $BASH_SOURCE[0] to determine directories to work in. +# $0 to determine directories to work in. -cd "$( dirname "${BASH_SOURCE[0]}" )" -rm -rf node_modules/babel-eslint +cd "$( dirname "${0}" )" || exit +rm -rf node_modules/@babel mkdir babel-eslint-tmp -cd babel-eslint-tmp +cd babel-eslint-tmp || exit npm init --yes -npm install --global-style --no-bin-links --production --no-package-lock babel-eslint@latest +npm install --global-style --no-bin-links --production --no-package-lock @babel/core @babel/eslint-parser@latest @babel/plugin-syntax-class-properties@latest # Use dmn to remove some unneeded files. npx dmn@2.2.2 -f clean @@ -22,5 +22,5 @@ npx dmn@2.2.2 -f clean npx removeNPMAbsolutePaths@1.0.4 . cd .. -mv babel-eslint-tmp/node_modules/babel-eslint node_modules/babel-eslint +mv babel-eslint-tmp/node_modules/@babel node_modules/@babel rm -rf babel-eslint-tmp/

): n is P`, + `export function is(type: string, n: Node | null | undefined, required?: Partial): n is Node`, + `export function isBinding(node: Node, parent: Node, grandparent?: Node): boolean`, + // eslint-disable-next-line max-len + `export function isBlockScoped(node: Node): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration`, + `export function isImmutable(node: Node): node is Immutable`, + `export function isLet(node: Node): node is VariableDeclaration`, + `export function isNode(node: object | null | undefined): node is Node`, + `export function isNodesEquivalent>(a: T, b: any): b is T`, + `export function isNodesEquivalent(a: any, b: any): boolean`, + `export function isPlaceholderType(placeholderType: Node['type'], targetType: Node['type']): boolean`, + `export function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean`, + `export function isScope(node: Node, parent: Node): node is Scopable`, + `export function isSpecifierDefault(specifier: ModuleSpecifier): boolean`, + `export function isType(nodetype: string, targetType: T): nodetype is T`, + `export function isType(nodetype: string | null | undefined, targetType: string): boolean`, + `export function isValidES3Identifier(name: string): boolean`, + `export function isValidIdentifier(name: string): boolean`, + `export function isVar(node: Node): node is VariableDeclaration`, + // the MemberExpression implication is incidental, but it follows from the implementation + // eslint-disable-next-line max-len + `export function matchesPattern(node: Node | null | undefined, match: string | ReadonlyArray, allowPartial?: boolean): node is MemberExpression`, + // eslint-disable-next-line max-len + `export function validate(n: Node | null | undefined, key: K, value: T[K]): ${asserts( + "n is T" + )}`, + `export function validate(n: Node, key: string, value: any): void;` +); + +for (const type in t.DEPRECATED_KEYS) { + code += `/** + * @deprecated Use \`${t.DEPRECATED_KEYS[type]}\` + */ +export type ${type} = ${t.DEPRECATED_KEYS[type]};\n +`; +} + +for (const type in t.FLIPPED_ALIAS_KEYS) { + const types = t.FLIPPED_ALIAS_KEYS[type]; + code += `export type ${type} = ${types + .map(type => `${type}`) + .join(" | ")};\n`; +} +code += "\n"; + +code += "export interface Aliases {\n"; +for (const type in t.FLIPPED_ALIAS_KEYS) { + code += ` ${type}: ${type};\n`; +} +code += "}\n\n"; + +code += lines.join("\n") + "\n"; + +// + +process.stdout.write(code); + +// + +function areAllRemainingFieldsNullable(fieldName, fieldNames, fields) { + const index = fieldNames.indexOf(fieldName); + return fieldNames.slice(index).every(_ => isNullable(fields[_])); +} + +function hasDefault(field) { + return field.default != null; +} + +function isNullable(field) { + return field.optional || hasDefault(field); +} + +function sortFieldNames(fields, type) { + return fields.sort((fieldA, fieldB) => { + const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); + const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); + if (indexA === indexB) return fieldA < fieldB ? -1 : 1; + if (indexA === -1) return 1; + if (indexB === -1) return -1; + return indexA - indexB; + }); +} diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/formatBuilderName.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/formatBuilderName.js similarity index 62% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/formatBuilderName.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/formatBuilderName.js index 1b543a9bfaf570..621c468219519d 100644 --- a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/formatBuilderName.js +++ b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/formatBuilderName.js @@ -5,5 +5,6 @@ const toLowerCase = Function.call.bind("".toLowerCase); module.exports = function formatBuilderName(type) { // FunctionExpression -> functionExpression // JSXIdentifier -> jsxIdentifier - return type.replace(/^([A-Z](?=[a-z])|[A-Z]+(?=[A-Z]))/, toLowerCase); + // V8IntrinsicIdentifier -> v8IntrinsicIdentifier + return type.replace(/^([A-Z](?=[a-z0-9])|[A-Z]+(?=[A-Z]))/, toLowerCase); }; diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/lowerFirst.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/lowerFirst.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/lowerFirst.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/lowerFirst.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/stringifyValidator.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/stringifyValidator.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/stringifyValidator.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/stringifyValidator.js diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/toFunctionName.js b/tools/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/toFunctionName.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/@babel/types/scripts/utils/toFunctionName.js rename to tools/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/toFunctionName.js diff --git a/tools/node_modules/babel-eslint/node_modules/ansi-styles/index.js b/tools/node_modules/@babel/core/node_modules/ansi-styles/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/ansi-styles/index.js rename to tools/node_modules/@babel/core/node_modules/ansi-styles/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/ansi-styles/license b/tools/node_modules/@babel/core/node_modules/ansi-styles/license similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/ansi-styles/license rename to tools/node_modules/@babel/core/node_modules/ansi-styles/license diff --git a/tools/node_modules/@babel/core/node_modules/ansi-styles/package.json b/tools/node_modules/@babel/core/node_modules/ansi-styles/package.json new file mode 100644 index 00000000000000..65edb48c399c5c --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/ansi-styles/package.json @@ -0,0 +1,56 @@ +{ + "name": "ansi-styles", + "version": "3.2.1", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "color-convert": "^1.9.0" + }, + "devDependencies": { + "ava": "*", + "babel-polyfill": "^6.23.0", + "svg-term-cli": "^2.1.1", + "xo": "*" + }, + "ava": { + "require": "babel-polyfill" + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/ansi-styles/readme.md b/tools/node_modules/@babel/core/node_modules/ansi-styles/readme.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/ansi-styles/readme.md rename to tools/node_modules/@babel/core/node_modules/ansi-styles/readme.md diff --git a/tools/node_modules/babel-eslint/node_modules/chalk/index.js b/tools/node_modules/@babel/core/node_modules/chalk/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/chalk/index.js rename to tools/node_modules/@babel/core/node_modules/chalk/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/chalk/index.js.flow b/tools/node_modules/@babel/core/node_modules/chalk/index.js.flow similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/chalk/index.js.flow rename to tools/node_modules/@babel/core/node_modules/chalk/index.js.flow diff --git a/tools/node_modules/babel-eslint/node_modules/chalk/license b/tools/node_modules/@babel/core/node_modules/chalk/license similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/chalk/license rename to tools/node_modules/@babel/core/node_modules/chalk/license diff --git a/tools/node_modules/@babel/core/node_modules/chalk/package.json b/tools/node_modules/@babel/core/node_modules/chalk/package.json new file mode 100644 index 00000000000000..bc324685a7625f --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/chalk/package.json @@ -0,0 +1,71 @@ +{ + "name": "chalk", + "version": "2.4.2", + "description": "Terminal string styling done right", + "license": "MIT", + "repository": "chalk/chalk", + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava", + "bench": "matcha benchmark.js", + "coveralls": "nyc report --reporter=text-lcov | coveralls" + }, + "files": [ + "index.js", + "templates.js", + "types/index.d.ts", + "index.js.flow" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "devDependencies": { + "ava": "*", + "coveralls": "^3.0.0", + "execa": "^0.9.0", + "flow-bin": "^0.68.0", + "import-fresh": "^2.0.0", + "matcha": "^0.7.0", + "nyc": "^11.0.2", + "resolve-from": "^4.0.0", + "typescript": "^2.5.3", + "xo": "*" + }, + "types": "types/index.d.ts", + "xo": { + "envs": [ + "node", + "mocha" + ], + "ignores": [ + "test/_flow.js" + ] + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/chalk/readme.md b/tools/node_modules/@babel/core/node_modules/chalk/readme.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/chalk/readme.md rename to tools/node_modules/@babel/core/node_modules/chalk/readme.md diff --git a/tools/node_modules/babel-eslint/node_modules/chalk/templates.js b/tools/node_modules/@babel/core/node_modules/chalk/templates.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/chalk/templates.js rename to tools/node_modules/@babel/core/node_modules/chalk/templates.js diff --git a/tools/node_modules/babel-eslint/node_modules/color-convert/LICENSE b/tools/node_modules/@babel/core/node_modules/color-convert/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/color-convert/LICENSE rename to tools/node_modules/@babel/core/node_modules/color-convert/LICENSE diff --git a/tools/node_modules/babel-eslint/node_modules/color-convert/README.md b/tools/node_modules/@babel/core/node_modules/color-convert/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/color-convert/README.md rename to tools/node_modules/@babel/core/node_modules/color-convert/README.md diff --git a/tools/node_modules/babel-eslint/node_modules/color-convert/conversions.js b/tools/node_modules/@babel/core/node_modules/color-convert/conversions.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/color-convert/conversions.js rename to tools/node_modules/@babel/core/node_modules/color-convert/conversions.js diff --git a/tools/node_modules/babel-eslint/node_modules/color-convert/index.js b/tools/node_modules/@babel/core/node_modules/color-convert/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/color-convert/index.js rename to tools/node_modules/@babel/core/node_modules/color-convert/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/color-convert/package.json b/tools/node_modules/@babel/core/node_modules/color-convert/package.json similarity index 65% rename from tools/node_modules/babel-eslint/node_modules/color-convert/package.json rename to tools/node_modules/@babel/core/node_modules/color-convert/package.json index 991f69308c29f4..dfbc471407ff4c 100644 --- a/tools/node_modules/babel-eslint/node_modules/color-convert/package.json +++ b/tools/node_modules/@babel/core/node_modules/color-convert/package.json @@ -1,28 +1,14 @@ { - "author": { - "name": "Heather Arthur", - "email": "fayearthur@gmail.com" - }, - "bugs": { - "url": "https://github.com/Qix-/color-convert/issues" - }, - "bundleDependencies": false, - "dependencies": { - "color-name": "1.1.3" - }, - "deprecated": false, + "name": "color-convert", "description": "Plain color conversion functions", - "devDependencies": { - "chalk": "1.1.1", - "xo": "0.11.2" + "version": "1.9.3", + "author": "Heather Arthur ", + "license": "MIT", + "repository": "Qix-/color-convert", + "scripts": { + "pretest": "xo", + "test": "node test/basic.js" }, - "files": [ - "index.js", - "conversions.js", - "css-keywords.js", - "route.js" - ], - "homepage": "https://github.com/Qix-/color-convert#readme", "keywords": [ "color", "colour", @@ -37,22 +23,24 @@ "ansi", "ansi16" ], - "license": "MIT", - "name": "color-convert", - "repository": { - "type": "git", - "url": "git+https://github.com/Qix-/color-convert.git" - }, - "scripts": { - "pretest": "xo", - "test": "node test/basic.js" - }, - "version": "1.9.3", + "files": [ + "index.js", + "conversions.js", + "css-keywords.js", + "route.js" + ], "xo": { "rules": { "default-case": 0, "no-inline-comments": 0, "operator-linebreak": 0 } + }, + "devDependencies": { + "chalk": "1.1.1", + "xo": "0.11.2" + }, + "dependencies": { + "color-name": "1.1.3" } -} \ No newline at end of file +} diff --git a/tools/node_modules/babel-eslint/node_modules/color-convert/route.js b/tools/node_modules/@babel/core/node_modules/color-convert/route.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/color-convert/route.js rename to tools/node_modules/@babel/core/node_modules/color-convert/route.js diff --git a/tools/node_modules/babel-eslint/node_modules/color-name/LICENSE b/tools/node_modules/@babel/core/node_modules/color-name/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/color-name/LICENSE rename to tools/node_modules/@babel/core/node_modules/color-name/LICENSE diff --git a/tools/node_modules/babel-eslint/node_modules/color-name/README.md b/tools/node_modules/@babel/core/node_modules/color-name/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/color-name/README.md rename to tools/node_modules/@babel/core/node_modules/color-name/README.md diff --git a/tools/node_modules/babel-eslint/node_modules/color-name/index.js b/tools/node_modules/@babel/core/node_modules/color-name/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/color-name/index.js rename to tools/node_modules/@babel/core/node_modules/color-name/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/color-name/package.json b/tools/node_modules/@babel/core/node_modules/color-name/package.json similarity index 58% rename from tools/node_modules/babel-eslint/node_modules/color-name/package.json rename to tools/node_modules/@babel/core/node_modules/color-name/package.json index 87d0e72ec56239..d061123ef02f40 100644 --- a/tools/node_modules/babel-eslint/node_modules/color-name/package.json +++ b/tools/node_modules/@babel/core/node_modules/color-name/package.json @@ -1,30 +1,25 @@ { - "author": { - "name": "DY", - "email": "dfcreative@gmail.com" + "name": "color-name", + "version": "1.1.3", + "description": "A list of color names and its values", + "main": "index.js", + "scripts": { + "test": "node test.js" }, - "bugs": { - "url": "https://github.com/dfcreative/color-name/issues" + "repository": { + "type": "git", + "url": "git@github.com:dfcreative/color-name.git" }, - "bundleDependencies": false, - "deprecated": false, - "description": "A list of color names and its values", - "homepage": "https://github.com/dfcreative/color-name", "keywords": [ "color-name", "color", "color-keyword", "keyword" ], + "author": "DY ", "license": "MIT", - "main": "index.js", - "name": "color-name", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/dfcreative/color-name.git" - }, - "scripts": { - "test": "node test.js" + "bugs": { + "url": "https://github.com/dfcreative/color-name/issues" }, - "version": "1.1.3" -} \ No newline at end of file + "homepage": "https://github.com/dfcreative/color-name" +} diff --git a/tools/node_modules/@babel/core/node_modules/convert-source-map/LICENSE b/tools/node_modules/@babel/core/node_modules/convert-source-map/LICENSE new file mode 100644 index 00000000000000..41702c5043478f --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/convert-source-map/LICENSE @@ -0,0 +1,23 @@ +Copyright 2013 Thorsten Lorenz. +All rights reserved. + +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/tools/node_modules/@babel/core/node_modules/convert-source-map/README.md b/tools/node_modules/@babel/core/node_modules/convert-source-map/README.md new file mode 100644 index 00000000000000..86b218e051863b --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/convert-source-map/README.md @@ -0,0 +1,125 @@ +# convert-source-map [![build status](https://secure.travis-ci.org/thlorenz/convert-source-map.svg?branch=master)](http://travis-ci.org/thlorenz/convert-source-map) + +become a patron + +Converts a source-map from/to different formats and allows adding/changing properties. + +```js +var convert = require('convert-source-map'); + +var json = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .toJSON(); + +var modified = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .setProperty('sources', [ 'SRC/FOO.JS' ]) + .toJSON(); + +console.log(json); +console.log(modified); +``` + +```json +{"version":3,"file":"build/foo.min.js","sources":["src/foo.js"],"names":[],"mappings":"AAAA","sourceRoot":"/"} +{"version":3,"file":"build/foo.min.js","sources":["SRC/FOO.JS"],"names":[],"mappings":"AAAA","sourceRoot":"/"} +``` + +## API + +### fromObject(obj) + +Returns source map converter from given object. + +### fromJSON(json) + +Returns source map converter from given json string. + +### fromBase64(base64) + +Returns source map converter from given base64 encoded json string. + +### fromComment(comment) + +Returns source map converter from given base64 encoded json string prefixed with `//# sourceMappingURL=...`. + +### fromMapFileComment(comment, mapFileDir) + +Returns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`. + +`filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the +generated file, i.e. the one containing the source map. + +### fromSource(source) + +Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. + +### fromMapFileSource(source, mapFileDir) + +Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was +found. + +The sourcemap will be read from the map file found by parsing `# sourceMappingURL=file` comment. For more info see +fromMapFileComment. + +### toObject() + +Returns a copy of the underlying source map. + +### toJSON([space]) + +Converts source map to json string. If `space` is given (optional), this will be passed to +[JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the +JSON string is generated. + +### toBase64() + +Converts source map to base64 encoded json string. + +### toComment([options]) + +Converts source map to an inline comment that can be appended to the source-file. + +By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would +normally see in a JS source file. + +When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. + +### addProperty(key, value) + +Adds given property to the source map. Throws an error if property already exists. + +### setProperty(key, value) + +Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated. + +### getProperty(key) + +Gets given property of the source map. + +### removeComments(src) + +Returns `src` with all source map comments removed + +### removeMapFileComments(src) + +Returns `src` with all source map comments pointing to map files removed. + +### commentRegex + +Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments. + +### mapFileCommentRegex + +Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments pointing to map files. + +### generateMapFileComment(file, [options]) + +Returns a comment that links to an external source map via `file`. + +By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would normally see in a JS source file. + +When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. + + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/convert-source-map/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/tools/node_modules/@babel/core/node_modules/convert-source-map/index.js b/tools/node_modules/@babel/core/node_modules/convert-source-map/index.js new file mode 100644 index 00000000000000..3aeae10484dae4 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/convert-source-map/index.js @@ -0,0 +1,136 @@ +'use strict'; +var fs = require('fs'); +var path = require('path'); +var SafeBuffer = require('safe-buffer'); + +Object.defineProperty(exports, 'commentRegex', { + get: function getCommentRegex () { + return /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg; + } +}); + +Object.defineProperty(exports, 'mapFileCommentRegex', { + get: function getMapFileCommentRegex () { + // Matches sourceMappingURL in either // or /* comment styles. + return /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg; + } +}); + + +function decodeBase64(base64) { + return SafeBuffer.Buffer.from(base64, 'base64').toString(); +} + +function stripComment(sm) { + return sm.split(',').pop(); +} + +function readFromFileMap(sm, dir) { + // NOTE: this will only work on the server since it attempts to read the map file + + var r = exports.mapFileCommentRegex.exec(sm); + + // for some odd reason //# .. captures in 1 and /* .. */ in 2 + var filename = r[1] || r[2]; + var filepath = path.resolve(dir, filename); + + try { + return fs.readFileSync(filepath, 'utf8'); + } catch (e) { + throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e); + } +} + +function Converter (sm, opts) { + opts = opts || {}; + + if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir); + if (opts.hasComment) sm = stripComment(sm); + if (opts.isEncoded) sm = decodeBase64(sm); + if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm); + + this.sourcemap = sm; +} + +Converter.prototype.toJSON = function (space) { + return JSON.stringify(this.sourcemap, null, space); +}; + +Converter.prototype.toBase64 = function () { + var json = this.toJSON(); + return SafeBuffer.Buffer.from(json, 'utf8').toString('base64'); +}; + +Converter.prototype.toComment = function (options) { + var base64 = this.toBase64(); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; +}; + +// returns copy instead of original +Converter.prototype.toObject = function () { + return JSON.parse(this.toJSON()); +}; + +Converter.prototype.addProperty = function (key, value) { + if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead'); + return this.setProperty(key, value); +}; + +Converter.prototype.setProperty = function (key, value) { + this.sourcemap[key] = value; + return this; +}; + +Converter.prototype.getProperty = function (key) { + return this.sourcemap[key]; +}; + +exports.fromObject = function (obj) { + return new Converter(obj); +}; + +exports.fromJSON = function (json) { + return new Converter(json, { isJSON: true }); +}; + +exports.fromBase64 = function (base64) { + return new Converter(base64, { isEncoded: true }); +}; + +exports.fromComment = function (comment) { + comment = comment + .replace(/^\/\*/g, '//') + .replace(/\*\/$/g, ''); + + return new Converter(comment, { isEncoded: true, hasComment: true }); +}; + +exports.fromMapFileComment = function (comment, dir) { + return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true }); +}; + +// Finds last sourcemap comment in file or returns null if none was found +exports.fromSource = function (content) { + var m = content.match(exports.commentRegex); + return m ? exports.fromComment(m.pop()) : null; +}; + +// Finds last sourcemap comment in file or returns null if none was found +exports.fromMapFileSource = function (content, dir) { + var m = content.match(exports.mapFileCommentRegex); + return m ? exports.fromMapFileComment(m.pop(), dir) : null; +}; + +exports.removeComments = function (src) { + return src.replace(exports.commentRegex, ''); +}; + +exports.removeMapFileComments = function (src) { + return src.replace(exports.mapFileCommentRegex, ''); +}; + +exports.generateMapFileComment = function (file, options) { + var data = 'sourceMappingURL=' + file; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; +}; diff --git a/tools/node_modules/@babel/core/node_modules/convert-source-map/package.json b/tools/node_modules/@babel/core/node_modules/convert-source-map/package.json new file mode 100644 index 00000000000000..c1a9592cfb0393 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/convert-source-map/package.json @@ -0,0 +1,44 @@ +{ + "name": "convert-source-map", + "version": "1.7.0", + "description": "Converts a source-map from/to different formats and allows adding/changing properties.", + "main": "index.js", + "scripts": { + "test": "tap test/*.js --color" + }, + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/convert-source-map.git" + }, + "homepage": "https://github.com/thlorenz/convert-source-map", + "dependencies": { + "safe-buffer": "~5.1.1" + }, + "devDependencies": { + "inline-source-map": "~0.6.2", + "tap": "~9.0.0" + }, + "keywords": [ + "convert", + "sourcemap", + "source", + "map", + "browser", + "debug" + ], + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "http://thlorenz.com" + }, + "license": "MIT", + "engine": { + "node": ">=0.6" + }, + "files": [ + "index.js" + ], + "browser": { + "fs": false + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/debug/LICENSE b/tools/node_modules/@babel/core/node_modules/debug/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/debug/LICENSE rename to tools/node_modules/@babel/core/node_modules/debug/LICENSE diff --git a/tools/node_modules/babel-eslint/node_modules/debug/README.md b/tools/node_modules/@babel/core/node_modules/debug/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/debug/README.md rename to tools/node_modules/@babel/core/node_modules/debug/README.md diff --git a/tools/node_modules/@babel/core/node_modules/debug/package.json b/tools/node_modules/@babel/core/node_modules/debug/package.json new file mode 100644 index 00000000000000..da809d2b8d28b2 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/debug/package.json @@ -0,0 +1,59 @@ +{ + "name": "debug", + "version": "4.3.1", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "LICENSE", + "README.md" + ], + "author": "TJ Holowaychuk ", + "contributors": [ + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne ", + "Josh Junon " + ], + "license": "MIT", + "scripts": { + "lint": "xo", + "test": "npm run test:node && npm run test:browser && npm run lint", + "test:node": "istanbul cover _mocha -- test.js", + "test:browser": "karma start --single-run", + "test:coverage": "cat ./coverage/lcov.info | coveralls" + }, + "dependencies": { + "ms": "2.1.2" + }, + "devDependencies": { + "brfs": "^2.0.1", + "browserify": "^16.2.3", + "coveralls": "^3.0.2", + "istanbul": "^0.4.5", + "karma": "^3.1.4", + "karma-browserify": "^6.0.0", + "karma-chrome-launcher": "^2.2.0", + "karma-mocha": "^1.3.0", + "mocha": "^5.2.0", + "mocha-lcov-reporter": "^1.2.0", + "xo": "^0.23.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "engines": { + "node": ">=6.0" + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/debug/src/browser.js b/tools/node_modules/@babel/core/node_modules/debug/src/browser.js similarity index 91% rename from tools/node_modules/babel-eslint/node_modules/debug/src/browser.js rename to tools/node_modules/@babel/core/node_modules/debug/src/browser.js index 5f34c0d0a73f02..cd0fc35d1ee11e 100644 --- a/tools/node_modules/babel-eslint/node_modules/debug/src/browser.js +++ b/tools/node_modules/@babel/core/node_modules/debug/src/browser.js @@ -4,12 +4,21 @@ * This is the web browser implementation of `debug()`. */ -exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); /** * Colors. @@ -170,18 +179,14 @@ function formatArgs(args) { } /** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. * * @api public */ -function log(...args) { - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return typeof console === 'object' && - console.log && - console.log(...args); -} +exports.log = console.debug || console.log || (() => {}); /** * Save `namespaces`. diff --git a/tools/node_modules/babel-eslint/node_modules/debug/src/common.js b/tools/node_modules/@babel/core/node_modules/debug/src/common.js similarity index 87% rename from tools/node_modules/babel-eslint/node_modules/debug/src/common.js rename to tools/node_modules/@babel/core/node_modules/debug/src/common.js index 2f82b8dc7d8865..392a8e005a063a 100644 --- a/tools/node_modules/babel-eslint/node_modules/debug/src/common.js +++ b/tools/node_modules/@babel/core/node_modules/debug/src/common.js @@ -12,16 +12,12 @@ function setup(env) { createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); + createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); - /** - * Active `debug` instances. - */ - createDebug.instances = []; - /** * The currently active debug mode names, and names to skip. */ @@ -63,6 +59,7 @@ function setup(env) { */ function createDebug(namespace) { let prevTime; + let enableOverride = null; function debug(...args) { // Disabled? @@ -92,7 +89,7 @@ function setup(env) { args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { - return match; + return '%'; } index++; const formatter = createDebug.formatters[format]; @@ -115,33 +112,28 @@ function setup(env) { } debug.namespace = namespace; - debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); - debug.color = selectColor(namespace); - debug.destroy = destroy; + debug.color = createDebug.selectColor(namespace); debug.extend = extend; - // Debug.formatArgs = formatArgs; - // debug.rawLog = rawLog; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride, + set: v => { + enableOverride = v; + } + }); - // env-specific initialization logic for debug instances + // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } - createDebug.instances.push(debug); - return debug; } - function destroy() { - const index = createDebug.instances.indexOf(this); - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - return false; - } - function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; @@ -179,11 +171,6 @@ function setup(env) { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } - - for (i = 0; i < createDebug.instances.length; i++) { - const instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } } /** @@ -258,6 +245,14 @@ function setup(env) { return val; } + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + createDebug.enable(createDebug.load()); return createDebug; diff --git a/tools/node_modules/babel-eslint/node_modules/debug/src/index.js b/tools/node_modules/@babel/core/node_modules/debug/src/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/debug/src/index.js rename to tools/node_modules/@babel/core/node_modules/debug/src/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/debug/src/node.js b/tools/node_modules/@babel/core/node_modules/debug/src/node.js similarity index 94% rename from tools/node_modules/babel-eslint/node_modules/debug/src/node.js rename to tools/node_modules/@babel/core/node_modules/debug/src/node.js index 5e1f1541a05593..79bc085cb0230c 100644 --- a/tools/node_modules/babel-eslint/node_modules/debug/src/node.js +++ b/tools/node_modules/@babel/core/node_modules/debug/src/node.js @@ -15,6 +15,10 @@ exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); /** * Colors. @@ -244,7 +248,9 @@ const {formatters} = module.exports; formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) - .replace(/\s*\n\s*/g, ' '); + .split('\n') + .map(str => str.trim()) + .join(' '); }; /** diff --git a/tools/node_modules/babel-eslint/node_modules/escape-string-regexp/index.js b/tools/node_modules/@babel/core/node_modules/escape-string-regexp/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/escape-string-regexp/index.js rename to tools/node_modules/@babel/core/node_modules/escape-string-regexp/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/escape-string-regexp/license b/tools/node_modules/@babel/core/node_modules/escape-string-regexp/license similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/escape-string-regexp/license rename to tools/node_modules/@babel/core/node_modules/escape-string-regexp/license diff --git a/tools/node_modules/@babel/core/node_modules/escape-string-regexp/package.json b/tools/node_modules/@babel/core/node_modules/escape-string-regexp/package.json new file mode 100644 index 00000000000000..f307df34a232c0 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/escape-string-regexp/package.json @@ -0,0 +1,41 @@ +{ + "name": "escape-string-regexp", + "version": "1.0.5", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": "sindresorhus/escape-string-regexp", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + "Sindre Sorhus (sindresorhus.com)", + "Joshua Boy Nicolai Appelman (jbna.nl)" + ], + "engines": { + "node": ">=0.8.0" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "escape", + "regex", + "regexp", + "re", + "regular", + "expression", + "string", + "str", + "special", + "characters" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/escape-string-regexp/readme.md b/tools/node_modules/@babel/core/node_modules/escape-string-regexp/readme.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/escape-string-regexp/readme.md rename to tools/node_modules/@babel/core/node_modules/escape-string-regexp/readme.md diff --git a/tools/node_modules/@babel/core/node_modules/function-bind/.jscs.json b/tools/node_modules/@babel/core/node_modules/function-bind/.jscs.json new file mode 100644 index 00000000000000..8c4479480be70d --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/function-bind/.jscs.json @@ -0,0 +1,176 @@ +{ + "es3": true, + + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "ForInStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": { "allExcept": ["keywords"] }, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 8 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": "asc-insensitive", + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true +} + diff --git a/tools/node_modules/@babel/core/node_modules/function-bind/LICENSE b/tools/node_modules/@babel/core/node_modules/function-bind/LICENSE new file mode 100644 index 00000000000000..62d6d237ff179b --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/function-bind/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2013 Raynos. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/tools/node_modules/@babel/core/node_modules/function-bind/README.md b/tools/node_modules/@babel/core/node_modules/function-bind/README.md new file mode 100644 index 00000000000000..81862a02cb940c --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/function-bind/README.md @@ -0,0 +1,48 @@ +# function-bind + + + + + +Implementation of function.prototype.bind + +## Example + +I mainly do this for unit tests I run on phantomjs. +PhantomJS does not have Function.prototype.bind :( + +```js +Function.prototype.bind = require("function-bind") +``` + +## Installation + +`npm install function-bind` + +## Contributors + + - Raynos + +## MIT Licenced + + [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg + [travis-url]: https://travis-ci.org/Raynos/function-bind + [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg + [npm-url]: https://npmjs.org/package/function-bind + [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png + [6]: https://coveralls.io/r/Raynos/function-bind + [7]: https://gemnasium.com/Raynos/function-bind.png + [8]: https://gemnasium.com/Raynos/function-bind + [deps-svg]: https://david-dm.org/Raynos/function-bind.svg + [deps-url]: https://david-dm.org/Raynos/function-bind + [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg + [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies + [11]: https://ci.testling.com/Raynos/function-bind.png + [12]: https://ci.testling.com/Raynos/function-bind diff --git a/tools/node_modules/@babel/core/node_modules/function-bind/implementation.js b/tools/node_modules/@babel/core/node_modules/function-bind/implementation.js new file mode 100644 index 00000000000000..cc4daec1b080a1 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/function-bind/implementation.js @@ -0,0 +1,52 @@ +'use strict'; + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice.call(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; diff --git a/tools/node_modules/@babel/core/node_modules/function-bind/index.js b/tools/node_modules/@babel/core/node_modules/function-bind/index.js new file mode 100644 index 00000000000000..3bb6b9609889f8 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/function-bind/index.js @@ -0,0 +1,5 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; diff --git a/tools/node_modules/@babel/core/node_modules/function-bind/package.json b/tools/node_modules/@babel/core/node_modules/function-bind/package.json new file mode 100644 index 00000000000000..20a1727cbf8711 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/function-bind/package.json @@ -0,0 +1,63 @@ +{ + "name": "function-bind", + "version": "1.1.1", + "description": "Implementation of Function.prototype.bind", + "keywords": [ + "function", + "bind", + "shim", + "es5" + ], + "author": "Raynos ", + "repository": "git://github.com/Raynos/function-bind.git", + "main": "index", + "homepage": "https://github.com/Raynos/function-bind", + "contributors": [ + { + "name": "Raynos" + }, + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "bugs": { + "url": "https://github.com/Raynos/function-bind/issues", + "email": "raynos2@gmail.com" + }, + "dependencies": {}, + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "covert": "^1.1.0", + "eslint": "^4.5.0", + "jscs": "^3.0.7", + "tape": "^4.8.0" + }, + "license": "MIT", + "scripts": { + "pretest": "npm run lint", + "test": "npm run tests-only", + "posttest": "npm run coverage -- --quiet", + "tests-only": "node test", + "coverage": "covert test/*.js", + "lint": "npm run jscs && npm run eslint", + "jscs": "jscs *.js */*.js", + "eslint": "eslint *.js */*.js" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/tools/node_modules/@babel/core/node_modules/gensync/LICENSE b/tools/node_modules/@babel/core/node_modules/gensync/LICENSE new file mode 100644 index 00000000000000..af7f781f59eed4 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/gensync/LICENSE @@ -0,0 +1,7 @@ +Copyright 2018 Logan Smyth + +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/tools/node_modules/@babel/core/node_modules/gensync/README.md b/tools/node_modules/@babel/core/node_modules/gensync/README.md new file mode 100644 index 00000000000000..f68ce1a37b927d --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/gensync/README.md @@ -0,0 +1,196 @@ +# gensync + +This module allows for developers to write common code that can share +implementation details, hiding whether an underlying request happens +synchronously or asynchronously. This is in contrast with many current Node +APIs which explicitly implement the same API twice, once with calls to +synchronous functions, and once with asynchronous functions. + +Take for example `fs.readFile` and `fs.readFileSync`, if you're writing an API +that loads a file and then performs a synchronous operation on the data, it +can be frustrating to maintain two parallel functions. + + +## Example + +```js +const fs = require("fs"); +const gensync = require("gensync"); + +const readFile = gensync({ + sync: fs.readFileSync, + errback: fs.readFile, +}); + +const myOperation = gensync(function* (filename) { + const code = yield* readFile(filename, "utf8"); + + return "// some custom prefix\n" + code; +}); + +// Load and add the prefix synchronously: +const result = myOperation.sync("./some-file.js"); + +// Load and add the prefix asynchronously with promises: +myOperation.async("./some-file.js").then(result => { + +}); + +// Load and add the prefix asynchronously with promises: +myOperation.errback("./some-file.js", (err, result) => { + +}); +``` + +This could even be exposed as your official API by doing +```js +// Using the common 'Sync' suffix for sync functions, and 'Async' suffix for +// promise-returning versions. +exports.myOperationSync = myOperation.sync; +exports.myOperationAsync = myOperation.async; +exports.myOperation = myOperation.errback; +``` +or potentially expose one of the async versions as the default, with a +`.sync` property on the function to expose the synchronous version. +```js +module.exports = myOperation.errback; +module.exports.sync = myOperation.sync; +```` + + +## API + +### gensync(generatorFnOrOptions) + +Returns a function that can be "await"-ed in another `gensync` generator +function, or executed via + +* `.sync(...args)` - Returns the computed value, or throws. +* `.async(...args)` - Returns a promise for the computed value. +* `.errback(...args, (err, result) => {})` - Calls the callback with the computed value, or error. + + +#### Passed a generator + +Wraps the generator to populate the `.sync`/`.async`/`.errback` helpers above to +allow for evaluation of the generator for the final value. + +##### Example + +```js +const readFile = function* () { + return 42; +}; + +const readFileAndMore = gensync(function* (){ + const val = yield* readFile(); + return 42 + val; +}); + +// In general cases +const code = readFileAndMore.sync("./file.js", "utf8"); +readFileAndMore.async("./file.js", "utf8").then(code => {}) +readFileAndMore.errback("./file.js", "utf8", (err, code) => {}); + +// In a generator being called indirectly with .sync/.async/.errback +const code = yield* readFileAndMore("./file.js", "utf8"); +``` + + +#### Passed an options object + +* `opts.sync` + + Example: `(...args) => 4` + + A function that will be called when `.sync()` is called on the `gensync()` + result, or when the result is passed to `yield*` in another generator that + is being run synchronously. + + Also called for `.async()` calls if no async handlers are provided. + +* `opts.async` + + Example: `async (...args) => 4` + + A function that will be called when `.async()` or `.errback()` is called on + the `gensync()` result, or when the result is passed to `yield*` in another + generator that is being run asynchronously. + +* `opts.errback` + + Example: `(...args, cb) => cb(null, 4)` + + A function that will be called when `.async()` or `.errback()` is called on + the `gensync()` result, or when the result is passed to `yield*` in another + generator that is being run asynchronously. + + This option allows for simpler compatibility with many existing Node APIs, + and also avoids introducing the extra even loop turns that promises introduce + to access the result value. + +* `opts.name` + + Example: `"readFile"` + + A string name to apply to the returned function. If no value is provided, + the name of `errback`/`async`/`sync` functions will be used, with any + `Sync` or `Async` suffix stripped off. If the callback is simply named + with ES6 inference (same name as the options property), the name is ignored. + +* `opts.arity` + + Example: `4` + + A number for the length to set on the returned function. If no value + is provided, the length will be carried over from the `sync` function's + `length` value. + +##### Example + +```js +const readFile = gensync({ + sync: fs.readFileSync, + errback: fs.readFile, +}); + +const code = readFile.sync("./file.js", "utf8"); +readFile.async("./file.js", "utf8").then(code => {}) +readFile.errback("./file.js", "utf8", (err, code) => {}); +``` + + +### gensync.all(iterable) + +`Promise.all`-like combinator that works with an iterable of generator objects +that could be passed to `yield*` within a gensync generator. + +#### Example + +```js +const loadFiles = gensync(function* () { + return yield* gensync.all([ + readFile("./one.js"), + readFile("./two.js"), + readFile("./three.js"), + ]); +}); +``` + + +### gensync.race(iterable) + +`Promise.race`-like combinator that works with an iterable of generator objects +that could be passed to `yield*` within a gensync generator. + +#### Example + +```js +const loadFiles = gensync(function* () { + return yield* gensync.race([ + readFile("./one.js"), + readFile("./two.js"), + readFile("./three.js"), + ]); +}); +``` diff --git a/tools/node_modules/@babel/core/node_modules/gensync/index.js b/tools/node_modules/@babel/core/node_modules/gensync/index.js new file mode 100644 index 00000000000000..ee0ea6165958e9 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/gensync/index.js @@ -0,0 +1,373 @@ +"use strict"; + +// These use the global symbol registry so that multiple copies of this +// library can work together in case they are not deduped. +const GENSYNC_START = Symbol.for("gensync:v1:start"); +const GENSYNC_SUSPEND = Symbol.for("gensync:v1:suspend"); + +const GENSYNC_EXPECTED_START = "GENSYNC_EXPECTED_START"; +const GENSYNC_EXPECTED_SUSPEND = "GENSYNC_EXPECTED_SUSPEND"; +const GENSYNC_OPTIONS_ERROR = "GENSYNC_OPTIONS_ERROR"; +const GENSYNC_RACE_NONEMPTY = "GENSYNC_RACE_NONEMPTY"; +const GENSYNC_ERRBACK_NO_CALLBACK = "GENSYNC_ERRBACK_NO_CALLBACK"; + +module.exports = Object.assign( + function gensync(optsOrFn) { + let genFn = optsOrFn; + if (typeof optsOrFn !== "function") { + genFn = newGenerator(optsOrFn); + } else { + genFn = wrapGenerator(optsOrFn); + } + + return Object.assign(genFn, makeFunctionAPI(genFn)); + }, + { + all: buildOperation({ + name: "all", + arity: 1, + sync: function(args) { + const items = Array.from(args[0]); + return items.map(item => evaluateSync(item)); + }, + async: function(args, resolve, reject) { + const items = Array.from(args[0]); + + if (items.length === 0) { + Promise.resolve().then(() => resolve([])); + return; + } + + let count = 0; + const results = items.map(() => undefined); + items.forEach((item, i) => { + evaluateAsync( + item, + val => { + results[i] = val; + count += 1; + + if (count === results.length) resolve(results); + }, + reject + ); + }); + }, + }), + race: buildOperation({ + name: "race", + arity: 1, + sync: function(args) { + const items = Array.from(args[0]); + if (items.length === 0) { + throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY); + } + + return evaluateSync(items[0]); + }, + async: function(args, resolve, reject) { + const items = Array.from(args[0]); + if (items.length === 0) { + throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY); + } + + for (const item of items) { + evaluateAsync(item, resolve, reject); + } + }, + }), + } +); + +/** + * Given a generator function, return the standard API object that executes + * the generator and calls the callbacks. + */ +function makeFunctionAPI(genFn) { + const fns = { + sync: function(...args) { + return evaluateSync(genFn.apply(this, args)); + }, + async: function(...args) { + return new Promise((resolve, reject) => { + evaluateAsync(genFn.apply(this, args), resolve, reject); + }); + }, + errback: function(...args) { + const cb = args.pop(); + if (typeof cb !== "function") { + throw makeError( + "Asynchronous function called without callback", + GENSYNC_ERRBACK_NO_CALLBACK + ); + } + + let gen; + try { + gen = genFn.apply(this, args); + } catch (err) { + cb(err); + return; + } + + evaluateAsync(gen, val => cb(undefined, val), err => cb(err)); + }, + }; + return fns; +} + +function assertTypeof(type, name, value, allowUndefined) { + if ( + typeof value === type || + (allowUndefined && typeof value === "undefined") + ) { + return; + } + + let msg; + if (allowUndefined) { + msg = `Expected opts.${name} to be either a ${type}, or undefined.`; + } else { + msg = `Expected opts.${name} to be a ${type}.`; + } + + throw makeError(msg, GENSYNC_OPTIONS_ERROR); +} +function makeError(msg, code) { + return Object.assign(new Error(msg), { code }); +} + +/** + * Given an options object, return a new generator that dispatches the + * correct handler based on sync or async execution. + */ +function newGenerator({ name, arity, sync, async, errback }) { + assertTypeof("string", "name", name, true /* allowUndefined */); + assertTypeof("number", "arity", arity, true /* allowUndefined */); + assertTypeof("function", "sync", sync); + assertTypeof("function", "async", async, true /* allowUndefined */); + assertTypeof("function", "errback", errback, true /* allowUndefined */); + if (async && errback) { + throw makeError( + "Expected one of either opts.async or opts.errback, but got _both_.", + GENSYNC_OPTIONS_ERROR + ); + } + + if (typeof name !== "string") { + let fnName; + if (errback && errback.name && errback.name !== "errback") { + fnName = errback.name; + } + if (async && async.name && async.name !== "async") { + fnName = async.name.replace(/Async$/, ""); + } + if (sync && sync.name && sync.name !== "sync") { + fnName = sync.name.replace(/Sync$/, ""); + } + + if (typeof fnName === "string") { + name = fnName; + } + } + + if (typeof arity !== "number") { + arity = sync.length; + } + + return buildOperation({ + name, + arity, + sync: function(args) { + return sync.apply(this, args); + }, + async: function(args, resolve, reject) { + if (async) { + async.apply(this, args).then(resolve, reject); + } else if (errback) { + errback.call(this, ...args, (err, value) => { + if (err == null) resolve(value); + else reject(err); + }); + } else { + resolve(sync.apply(this, args)); + } + }, + }); +} + +function wrapGenerator(genFn) { + return setFunctionMetadata(genFn.name, genFn.length, function(...args) { + return genFn.apply(this, args); + }); +} + +function buildOperation({ name, arity, sync, async }) { + return setFunctionMetadata(name, arity, function*(...args) { + const resume = yield GENSYNC_START; + if (!resume) { + // Break the tail call to avoid a bug in V8 v6.X with --harmony enabled. + const res = sync.call(this, args); + return res; + } + + let result; + try { + async.call( + this, + args, + value => { + if (result) return; + + result = { value }; + resume(); + }, + err => { + if (result) return; + + result = { err }; + resume(); + } + ); + } catch (err) { + result = { err }; + resume(); + } + + // Suspend until the callbacks run. Will resume synchronously if the + // callback was already called. + yield GENSYNC_SUSPEND; + + if (result.hasOwnProperty("err")) { + throw result.err; + } + + return result.value; + }); +} + +function evaluateSync(gen) { + let value; + while (!({ value } = gen.next()).done) { + assertStart(value, gen); + } + return value; +} + +function evaluateAsync(gen, resolve, reject) { + (function step() { + try { + let value; + while (!({ value } = gen.next()).done) { + assertStart(value, gen); + + // If this throws, it is considered to have broken the contract + // established for async handlers. If these handlers are called + // synchronously, it is also considered bad behavior. + let sync = true; + let didSyncResume = false; + const out = gen.next(() => { + if (sync) { + didSyncResume = true; + } else { + step(); + } + }); + sync = false; + + assertSuspend(out, gen); + + if (!didSyncResume) { + // Callback wasn't called synchronously, so break out of the loop + // and let it call 'step' later. + return; + } + } + + return resolve(value); + } catch (err) { + return reject(err); + } + })(); +} + +function assertStart(value, gen) { + if (value === GENSYNC_START) return; + + throwError( + gen, + makeError( + `Got unexpected yielded value in gensync generator: ${JSON.stringify( + value + )}. Did you perhaps mean to use 'yield*' instead of 'yield'?`, + GENSYNC_EXPECTED_START + ) + ); +} +function assertSuspend({ value, done }, gen) { + if (!done && value === GENSYNC_SUSPEND) return; + + throwError( + gen, + makeError( + done + ? "Unexpected generator completion. If you get this, it is probably a gensync bug." + : `Expected GENSYNC_SUSPEND, got ${JSON.stringify( + value + )}. If you get this, it is probably a gensync bug.`, + GENSYNC_EXPECTED_SUSPEND + ) + ); +} + +function throwError(gen, err) { + // Call `.throw` so that users can step in a debugger to easily see which + // 'yield' passed an unexpected value. If the `.throw` call didn't throw + // back to the generator, we explicitly do it to stop the error + // from being swallowed by user code try/catches. + if (gen.throw) gen.throw(err); + throw err; +} + +function isIterable(value) { + return ( + !!value && + (typeof value === "object" || typeof value === "function") && + !value[Symbol.iterator] + ); +} + +function setFunctionMetadata(name, arity, fn) { + if (typeof name === "string") { + // This should always work on the supported Node versions, but for the + // sake of users that are compiling to older versions, we check for + // configurability so we don't throw. + const nameDesc = Object.getOwnPropertyDescriptor(fn, "name"); + if (!nameDesc || nameDesc.configurable) { + Object.defineProperty( + fn, + "name", + Object.assign(nameDesc || {}, { + configurable: true, + value: name, + }) + ); + } + } + + if (typeof arity === "number") { + const lengthDesc = Object.getOwnPropertyDescriptor(fn, "length"); + if (!lengthDesc || lengthDesc.configurable) { + Object.defineProperty( + fn, + "length", + Object.assign(lengthDesc || {}, { + configurable: true, + value: arity, + }) + ); + } + } + + return fn; +} diff --git a/tools/node_modules/@babel/core/node_modules/gensync/index.js.flow b/tools/node_modules/@babel/core/node_modules/gensync/index.js.flow new file mode 100644 index 00000000000000..fa22e0bad9757f --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/gensync/index.js.flow @@ -0,0 +1,32 @@ +// @flow + +opaque type Next = Function | void; +opaque type Yield = mixed; + +export type Gensync = { + (...args: Args): Handler, + sync(...args: Args): Return, + async(...args: Args): Promise, + // ...args: [...Args, Callback] + errback(...args: any[]): void, +}; + +export type Handler = Generator; +export type Options = { + sync(...args: Args): Return, + arity?: number, + name?: string, +} & ( + | { async?: (...args: Args) => Promise } + // ...args: [...Args, Callback] + | { errback(...args: any[]): void } +); + +declare module.exports: { + ( + Options | ((...args: Args) => Handler) + ): Gensync, + + all(Array>): Handler, + race(Array>): Handler, +}; diff --git a/tools/node_modules/@babel/core/node_modules/gensync/package.json b/tools/node_modules/@babel/core/node_modules/gensync/package.json new file mode 100644 index 00000000000000..07f87570d87b91 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/gensync/package.json @@ -0,0 +1,37 @@ +{ + "name": "gensync", + "version": "1.0.0-beta.2", + "license": "MIT", + "description": "Allows users to use generators in order to write common functions that can be both sync or async.", + "main": "index.js", + "author": "Logan Smyth ", + "homepage": "https://github.com/loganfsmyth/gensync", + "repository": { + "type": "git", + "url": "https://github.com/loganfsmyth/gensync.git" + }, + "scripts": { + "test": "jest" + }, + "engines": { + "node": ">=6.9.0" + }, + "keywords": [ + "async", + "sync", + "generators", + "async-await", + "callbacks" + ], + "devDependencies": { + "babel-core": "^6.26.3", + "babel-preset-env": "^1.6.1", + "eslint": "^4.19.1", + "eslint-config-prettier": "^2.9.0", + "eslint-plugin-node": "^6.0.1", + "eslint-plugin-prettier": "^2.6.0", + "flow-bin": "^0.71.0", + "jest": "^22.4.3", + "prettier": "^1.12.1" + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/globals/globals.json b/tools/node_modules/@babel/core/node_modules/globals/globals.json similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/globals/globals.json rename to tools/node_modules/@babel/core/node_modules/globals/globals.json diff --git a/tools/node_modules/babel-eslint/node_modules/globals/index.js b/tools/node_modules/@babel/core/node_modules/globals/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/globals/index.js rename to tools/node_modules/@babel/core/node_modules/globals/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/globals/license b/tools/node_modules/@babel/core/node_modules/globals/license similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/globals/license rename to tools/node_modules/@babel/core/node_modules/globals/license diff --git a/tools/node_modules/@babel/core/node_modules/globals/package.json b/tools/node_modules/@babel/core/node_modules/globals/package.json new file mode 100644 index 00000000000000..dfe459b6fa6015 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/globals/package.json @@ -0,0 +1,41 @@ +{ + "name": "globals", + "version": "11.12.0", + "description": "Global identifiers from different JavaScript environments", + "license": "MIT", + "repository": "sindresorhus/globals", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "globals.json" + ], + "keywords": [ + "globals", + "global", + "identifiers", + "variables", + "vars", + "jshint", + "eslint", + "environments" + ], + "devDependencies": { + "ava": "0.21.0", + "xo": "0.18.0" + }, + "xo": { + "ignores": [ + "get-browser-globals.js" + ] + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/globals/readme.md b/tools/node_modules/@babel/core/node_modules/globals/readme.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/globals/readme.md rename to tools/node_modules/@babel/core/node_modules/globals/readme.md diff --git a/tools/node_modules/babel-eslint/node_modules/has-flag/index.js b/tools/node_modules/@babel/core/node_modules/has-flag/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/has-flag/index.js rename to tools/node_modules/@babel/core/node_modules/has-flag/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/has-flag/license b/tools/node_modules/@babel/core/node_modules/has-flag/license similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/has-flag/license rename to tools/node_modules/@babel/core/node_modules/has-flag/license diff --git a/tools/node_modules/babel-eslint/node_modules/has-flag/package.json b/tools/node_modules/@babel/core/node_modules/has-flag/package.json similarity index 66% rename from tools/node_modules/babel-eslint/node_modules/has-flag/package.json rename to tools/node_modules/@babel/core/node_modules/has-flag/package.json index 1903ff01cf6766..e1eb17a15ed880 100644 --- a/tools/node_modules/babel-eslint/node_modules/has-flag/package.json +++ b/tools/node_modules/@babel/core/node_modules/has-flag/package.json @@ -1,26 +1,23 @@ { + "name": "has-flag", + "version": "3.0.0", + "description": "Check if argv has a specific flag", + "license": "MIT", + "repository": "sindresorhus/has-flag", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "bugs": { - "url": "https://github.com/sindresorhus/has-flag/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if argv has a specific flag", - "devDependencies": { - "ava": "*", - "xo": "*" - }, "engines": { "node": ">=4" }, + "scripts": { + "test": "xo && ava" + }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/has-flag#readme", "keywords": [ "has", "check", @@ -40,14 +37,8 @@ "minimist", "optimist" ], - "license": "MIT", - "name": "has-flag", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/has-flag.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} \ No newline at end of file + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/has-flag/readme.md b/tools/node_modules/@babel/core/node_modules/has-flag/readme.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/has-flag/readme.md rename to tools/node_modules/@babel/core/node_modules/has-flag/readme.md diff --git a/tools/node_modules/@babel/core/node_modules/has/LICENSE-MIT b/tools/node_modules/@babel/core/node_modules/has/LICENSE-MIT new file mode 100644 index 00000000000000..ae7014d385df3d --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/has/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 Thiago de Arruda + +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/tools/node_modules/@babel/core/node_modules/has/README.md b/tools/node_modules/@babel/core/node_modules/has/README.md new file mode 100644 index 00000000000000..635e3a4baab00b --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/has/README.md @@ -0,0 +1,18 @@ +# has + +> Object.prototype.hasOwnProperty.call shortcut + +## Installation + +```sh +npm install --save has +``` + +## Usage + +```js +var has = require('has'); + +has({}, 'hasOwnProperty'); // false +has(Object.prototype, 'hasOwnProperty'); // true +``` diff --git a/tools/node_modules/@babel/core/node_modules/has/package.json b/tools/node_modules/@babel/core/node_modules/has/package.json new file mode 100644 index 00000000000000..7c4592f16de071 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/has/package.json @@ -0,0 +1,48 @@ +{ + "name": "has", + "description": "Object.prototype.hasOwnProperty.call shortcut", + "version": "1.0.3", + "homepage": "https://github.com/tarruda/has", + "author": { + "name": "Thiago de Arruda", + "email": "tpadilha84@gmail.com" + }, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/tarruda/has.git" + }, + "bugs": { + "url": "https://github.com/tarruda/has/issues" + }, + "license": "MIT", + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT" + } + ], + "main": "./src", + "dependencies": { + "function-bind": "^1.1.1" + }, + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "eslint": "^4.19.1", + "tape": "^4.9.0" + }, + "engines": { + "node": ">= 0.4.0" + }, + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "tape test" + } +} diff --git a/tools/node_modules/@babel/core/node_modules/has/src/index.js b/tools/node_modules/@babel/core/node_modules/has/src/index.js new file mode 100644 index 00000000000000..dd92dd9094edb0 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/has/src/index.js @@ -0,0 +1,5 @@ +'use strict'; + +var bind = require('function-bind'); + +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); diff --git a/tools/node_modules/@babel/core/node_modules/is-core-module/LICENSE b/tools/node_modules/@babel/core/node_modules/is-core-module/LICENSE new file mode 100644 index 00000000000000..2e502872a74234 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/is-core-module/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Dave Justice + +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/tools/node_modules/@babel/core/node_modules/is-core-module/README.md b/tools/node_modules/@babel/core/node_modules/is-core-module/README.md new file mode 100644 index 00000000000000..479d6d24c0f041 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/is-core-module/README.md @@ -0,0 +1,37 @@ +# is-core-module [![Version Badge][2]][1] + +[![Build Status][3]][4] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Is this specifier a node.js core module? Optionally provide a node version to check; defaults to the current node version. + +## Example + +```js +var isCore = require('is-core-module'); +var assert = require('assert'); +assert(isCore('fs')); +assert(!isCore('butts')); +``` + +## Tests +Clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/is-core-module +[2]: https://versionbadg.es/inspect-js/is-core-module.svg +[3]: https://travis-ci.com/inspect-js/is-core-module.svg +[4]: https://travis-ci.com/inspect-js/is-core-module +[5]: https://david-dm.org/inspect-js/is-core-module.svg +[6]: https://david-dm.org/inspect-js/is-core-module +[7]: https://david-dm.org/inspect-js/is-core-module/dev-status.svg +[8]: https://david-dm.org/inspect-js/is-core-module#info=devDependencies +[11]: https://nodei.co/npm/is-core-module.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/is-core-module.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/is-core-module.svg +[downloads-url]: https://npm-stat.com/charts.html?package=is-core-module diff --git a/tools/node_modules/@babel/core/node_modules/is-core-module/core.json b/tools/node_modules/@babel/core/node_modules/is-core-module/core.json new file mode 100644 index 00000000000000..0238b61a4c71e4 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/is-core-module/core.json @@ -0,0 +1,83 @@ +{ + "assert": true, + "assert/strict": ">= 15", + "async_hooks": ">= 8", + "buffer_ieee754": "< 0.9.7", + "buffer": true, + "child_process": true, + "cluster": true, + "console": true, + "constants": true, + "crypto": true, + "_debug_agent": ">= 1 && < 8", + "_debugger": "< 8", + "dgram": true, + "diagnostics_channel": ">= 15.1", + "dns": true, + "dns/promises": ">= 15", + "domain": ">= 0.7.12", + "events": true, + "freelist": "< 6", + "fs": true, + "fs/promises": [">= 10 && < 10.1", ">= 14"], + "_http_agent": ">= 0.11.1", + "_http_client": ">= 0.11.1", + "_http_common": ">= 0.11.1", + "_http_incoming": ">= 0.11.1", + "_http_outgoing": ">= 0.11.1", + "_http_server": ">= 0.11.1", + "http": true, + "http2": ">= 8.8", + "https": true, + "inspector": ">= 8.0.0", + "_linklist": "< 8", + "module": true, + "net": true, + "node-inspect/lib/_inspect": ">= 7.6.0 && < 12", + "node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12", + "node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12", + "os": true, + "path": true, + "path/posix": ">= 15.3", + "path/win32": ">= 15.3", + "perf_hooks": ">= 8.5", + "process": ">= 1", + "punycode": true, + "querystring": true, + "readline": true, + "repl": true, + "smalloc": ">= 0.11.5 && < 3", + "_stream_duplex": ">= 0.9.4", + "_stream_transform": ">= 0.9.4", + "_stream_wrap": ">= 1.4.1", + "_stream_passthrough": ">= 0.9.4", + "_stream_readable": ">= 0.9.4", + "_stream_writable": ">= 0.9.4", + "stream": true, + "stream/promises": ">= 15", + "string_decoder": true, + "sys": [">= 0.6 && < 0.7", ">= 0.8"], + "timers": true, + "timers/promises": ">= 15", + "_tls_common": ">= 0.11.13", + "_tls_legacy": ">= 0.11.3 && < 10", + "_tls_wrap": ">= 0.11.3", + "tls": true, + "trace_events": ">= 10", + "tty": true, + "url": true, + "util": true, + "util/types": ">= 15.3", + "v8/tools/arguments": ">= 10 && < 12", + "v8/tools/codemap": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/consarray": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/csvparser": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/logreader": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/profile_view": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/splaytree": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8": ">= 1", + "vm": true, + "wasi": ">= 13.4 && < 13.5", + "worker_threads": ">= 11.7", + "zlib": true +} diff --git a/tools/node_modules/@babel/core/node_modules/is-core-module/index.js b/tools/node_modules/@babel/core/node_modules/is-core-module/index.js new file mode 100644 index 00000000000000..f5a69cf765f56b --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/is-core-module/index.js @@ -0,0 +1,69 @@ +'use strict'; + +var has = require('has'); + +function specifierIncluded(current, specifier) { + var nodeParts = current.split('.'); + var parts = specifier.split(' '); + var op = parts.length > 1 ? parts[0] : '='; + var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); + + for (var i = 0; i < 3; ++i) { + var cur = parseInt(nodeParts[i] || 0, 10); + var ver = parseInt(versionParts[i] || 0, 10); + if (cur === ver) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } + if (op === '<') { + return cur < ver; + } + if (op === '>=') { + return cur >= ver; + } + return false; + } + return op === '>='; +} + +function matchesRange(current, range) { + var specifiers = range.split(/ ?&& ?/); + if (specifiers.length === 0) { + return false; + } + for (var i = 0; i < specifiers.length; ++i) { + if (!specifierIncluded(current, specifiers[i])) { + return false; + } + } + return true; +} + +function versionIncluded(nodeVersion, specifierValue) { + if (typeof specifierValue === 'boolean') { + return specifierValue; + } + + var current = typeof nodeVersion === 'undefined' + ? process.versions && process.versions.node && process.versions.node + : nodeVersion; + + if (typeof current !== 'string') { + throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required'); + } + + if (specifierValue && typeof specifierValue === 'object') { + for (var i = 0; i < specifierValue.length; ++i) { + if (matchesRange(current, specifierValue[i])) { + return true; + } + } + return false; + } + return matchesRange(current, specifierValue); +} + +var data = require('./core.json'); + +module.exports = function isCore(x, nodeVersion) { + return has(data, x) && versionIncluded(nodeVersion, data[x]); +}; diff --git a/tools/node_modules/@babel/core/node_modules/is-core-module/package.json b/tools/node_modules/@babel/core/node_modules/is-core-module/package.json new file mode 100644 index 00000000000000..21341cc431a505 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/is-core-module/package.json @@ -0,0 +1,66 @@ +{ + "name": "is-core-module", + "version": "2.2.0", + "description": "Is this specifier a node.js core module?", + "main": "index.js", + "exports": { + ".": [ + { + "default": "./index.js" + }, + "./index.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "prepublish": "safe-publish-latest", + "lint": "eslint .", + "pretest": "npm run lint", + "tests-only": "tape 'test/**/*.js'", + "test": "nyc npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/is-core-module.git" + }, + "keywords": [ + "core", + "modules", + "module", + "npm", + "node", + "dependencies" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/is-core-module/issues" + }, + "homepage": "https://github.com/inspect-js/is-core-module", + "dependencies": { + "has": "^1.0.3" + }, + "devDependencies": { + "@ljharb/eslint-config": "^17.3.0", + "aud": "^1.1.3", + "auto-changelog": "^2.2.1", + "eslint": "^7.14.0", + "nyc": "^10.3.2", + "safe-publish-latest": "^1.1.4", + "tape": "^5.0.1" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/js-tokens/LICENSE b/tools/node_modules/@babel/core/node_modules/js-tokens/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/js-tokens/LICENSE rename to tools/node_modules/@babel/core/node_modules/js-tokens/LICENSE diff --git a/tools/node_modules/babel-eslint/node_modules/js-tokens/README.md b/tools/node_modules/@babel/core/node_modules/js-tokens/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/js-tokens/README.md rename to tools/node_modules/@babel/core/node_modules/js-tokens/README.md diff --git a/tools/node_modules/babel-eslint/node_modules/js-tokens/index.js b/tools/node_modules/@babel/core/node_modules/js-tokens/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/js-tokens/index.js rename to tools/node_modules/@babel/core/node_modules/js-tokens/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/js-tokens/package.json b/tools/node_modules/@babel/core/node_modules/js-tokens/package.json similarity index 53% rename from tools/node_modules/babel-eslint/node_modules/js-tokens/package.json rename to tools/node_modules/@babel/core/node_modules/js-tokens/package.json index ccfb4ef3dc3100..66752fab275101 100644 --- a/tools/node_modules/babel-eslint/node_modules/js-tokens/package.json +++ b/tools/node_modules/@babel/core/node_modules/js-tokens/package.json @@ -1,23 +1,9 @@ { - "author": { - "name": "Simon Lydell" - }, - "bugs": { - "url": "https://github.com/lydell/js-tokens/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "js-tokens", + "version": "4.0.0", + "author": "Simon Lydell", + "license": "MIT", "description": "A regex that tokenizes JavaScript.", - "devDependencies": { - "coffeescript": "2.1.1", - "esprima": "4.0.0", - "everything.js": "1.0.3", - "mocha": "5.0.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/lydell/js-tokens#readme", "keywords": [ "JavaScript", "js", @@ -25,17 +11,20 @@ "tokenize", "regex" ], - "license": "MIT", - "name": "js-tokens", - "repository": { - "type": "git", - "url": "git+https://github.com/lydell/js-tokens.git" - }, + "files": [ + "index.js" + ], + "repository": "lydell/js-tokens", "scripts": { - "build": "node generate-index.js", - "dev": "npm run build && npm test", + "test": "mocha --ui tdd", "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", - "test": "mocha --ui tdd" + "build": "node generate-index.js", + "dev": "npm run build && npm test" }, - "version": "4.0.0" -} \ No newline at end of file + "devDependencies": { + "coffeescript": "2.1.1", + "esprima": "4.0.0", + "everything.js": "1.0.3", + "mocha": "5.0.0" + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/jsesc/LICENSE-MIT.txt b/tools/node_modules/@babel/core/node_modules/jsesc/LICENSE-MIT.txt similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/jsesc/LICENSE-MIT.txt rename to tools/node_modules/@babel/core/node_modules/jsesc/LICENSE-MIT.txt diff --git a/tools/node_modules/babel-eslint/node_modules/jsesc/README.md b/tools/node_modules/@babel/core/node_modules/jsesc/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/jsesc/README.md rename to tools/node_modules/@babel/core/node_modules/jsesc/README.md diff --git a/tools/node_modules/babel-eslint/node_modules/jsesc/bin/jsesc b/tools/node_modules/@babel/core/node_modules/jsesc/bin/jsesc similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/jsesc/bin/jsesc rename to tools/node_modules/@babel/core/node_modules/jsesc/bin/jsesc diff --git a/tools/node_modules/babel-eslint/node_modules/jsesc/jsesc.js b/tools/node_modules/@babel/core/node_modules/jsesc/jsesc.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/jsesc/jsesc.js rename to tools/node_modules/@babel/core/node_modules/jsesc/jsesc.js diff --git a/tools/node_modules/babel-eslint/node_modules/jsesc/man/jsesc.1 b/tools/node_modules/@babel/core/node_modules/jsesc/man/jsesc.1 similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/jsesc/man/jsesc.1 rename to tools/node_modules/@babel/core/node_modules/jsesc/man/jsesc.1 diff --git a/tools/node_modules/babel-eslint/node_modules/jsesc/package.json b/tools/node_modules/@babel/core/node_modules/jsesc/package.json similarity index 79% rename from tools/node_modules/babel-eslint/node_modules/jsesc/package.json rename to tools/node_modules/@babel/core/node_modules/jsesc/package.json index 735096b93f9702..f89a7c62a04671 100644 --- a/tools/node_modules/babel-eslint/node_modules/jsesc/package.json +++ b/tools/node_modules/@babel/core/node_modules/jsesc/package.json @@ -1,36 +1,14 @@ { - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "bin": { - "jsesc": "bin/jsesc" - }, - "bugs": { - "url": "https://github.com/mathiasbynens/jsesc/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "jsesc", + "version": "2.5.2", "description": "Given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data.", - "devDependencies": { - "coveralls": "^2.11.6", - "grunt": "^0.4.5", - "grunt-template": "^0.2.3", - "istanbul": "^0.4.2", - "mocha": "*", - "regenerate": "^1.3.0", - "requirejs": "^2.1.22" - }, + "homepage": "https://mths.be/jsesc", "engines": { "node": ">=4" }, - "files": [ - "LICENSE-MIT.txt", - "jsesc.js", - "bin/", - "man/" - ], - "homepage": "https://mths.be/jsesc", + "main": "jsesc.js", + "bin": "bin/jsesc", + "man": "man/jsesc.1", "keywords": [ "buffer", "escape", @@ -43,20 +21,34 @@ "tool" ], "license": "MIT", - "main": "jsesc.js", - "man": [ - "man/jsesc.1" - ], - "name": "jsesc", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, "repository": { "type": "git", - "url": "git+https://github.com/mathiasbynens/jsesc.git" + "url": "https://github.com/mathiasbynens/jsesc.git" }, + "bugs": "https://github.com/mathiasbynens/jsesc/issues", + "files": [ + "LICENSE-MIT.txt", + "jsesc.js", + "bin/", + "man/" + ], "scripts": { "build": "grunt template", - "cover": "istanbul cover --report 'html' --verbose --dir 'coverage' 'tests/tests.js'", "coveralls": "istanbul cover --verbose --dir 'coverage' 'tests/tests.js' && coveralls < coverage/lcov.info'", + "cover": "istanbul cover --report 'html' --verbose --dir 'coverage' 'tests/tests.js'", "test": "mocha tests" }, - "version": "2.5.2" -} \ No newline at end of file + "devDependencies": { + "coveralls": "^2.11.6", + "grunt": "^0.4.5", + "grunt-template": "^0.2.3", + "istanbul": "^0.4.2", + "mocha": "*", + "regenerate": "^1.3.0", + "requirejs": "^2.1.22" + } +} diff --git a/tools/node_modules/@babel/core/node_modules/json5/LICENSE.md b/tools/node_modules/@babel/core/node_modules/json5/LICENSE.md new file mode 100644 index 00000000000000..2171aca5a833ac --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/LICENSE.md @@ -0,0 +1,23 @@ +MIT License + +Copyright (c) 2012-2018 Aseem Kishore, and [others]. + +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. + +[others]: https://github.com/json5/json5/contributors diff --git a/tools/node_modules/@babel/core/node_modules/json5/README.md b/tools/node_modules/@babel/core/node_modules/json5/README.md new file mode 100644 index 00000000000000..4f803270be0ae6 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/README.md @@ -0,0 +1,234 @@ +# JSON5 – JSON for Humans + +[![Build Status](https://travis-ci.org/json5/json5.svg)][Build Status] +[![Coverage +Status](https://coveralls.io/repos/github/json5/json5/badge.svg)][Coverage +Status] + +The JSON5 Data Interchange Format (JSON5) is a superset of [JSON] that aims to +alleviate some of the limitations of JSON by expanding its syntax to include +some productions from [ECMAScript 5.1]. + +This JavaScript library is the official reference implementation for JSON5 +parsing and serialization libraries. + +[Build Status]: https://travis-ci.org/json5/json5 + +[Coverage Status]: https://coveralls.io/github/json5/json5 + +[JSON]: https://tools.ietf.org/html/rfc7159 + +[ECMAScript 5.1]: https://www.ecma-international.org/ecma-262/5.1/ + +## Summary of Features +The following ECMAScript 5.1 features, which are not supported in JSON, have +been extended to JSON5. + +### Objects +- Object keys may be an ECMAScript 5.1 _[IdentifierName]_. +- Objects may have a single trailing comma. + +### Arrays +- Arrays may have a single trailing comma. + +### Strings +- Strings may be single quoted. +- Strings may span multiple lines by escaping new line characters. +- Strings may include character escapes. + +### Numbers +- Numbers may be hexadecimal. +- Numbers may have a leading or trailing decimal point. +- Numbers may be [IEEE 754] positive infinity, negative infinity, and NaN. +- Numbers may begin with an explicit plus sign. + +### Comments +- Single and multi-line comments are allowed. + +### White Space +- Additional white space characters are allowed. + +[IdentifierName]: https://www.ecma-international.org/ecma-262/5.1/#sec-7.6 + +[IEEE 754]: http://ieeexplore.ieee.org/servlet/opac?punumber=4610933 + +## Short Example +```js +{ + // comments + unquoted: 'and you can quote me on that', + singleQuotes: 'I can use "double quotes" here', + lineBreaks: "Look, Mom! \ +No \\n's!", + hexadecimal: 0xdecaf, + leadingDecimalPoint: .8675309, andTrailing: 8675309., + positiveSign: +1, + trailingComma: 'in objects', andIn: ['arrays',], + "backwardsCompatible": "with JSON", +} +``` + +## Specification +For a detailed explanation of the JSON5 format, please read the [official +specification](https://json5.github.io/json5-spec/). + +## Installation +### Node.js +```sh +npm install json5 +``` + +```js +const JSON5 = require('json5') +``` + +### Browsers +```html + +``` + +This will create a global `JSON5` variable. + +## API +The JSON5 API is compatible with the [JSON API]. + +[JSON API]: +https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON + +### JSON5.parse() +Parses a JSON5 string, constructing the JavaScript value or object described by +the string. An optional reviver function can be provided to perform a +transformation on the resulting object before it is returned. + +#### Syntax + JSON5.parse(text[, reviver]) + +#### Parameters +- `text`: The string to parse as JSON5. +- `reviver`: If a function, this prescribes how the value originally produced by + parsing is transformed, before being returned. + +#### Return value +The object corresponding to the given JSON5 text. + +### JSON5.stringify() +Converts a JavaScript value to a JSON5 string, optionally replacing values if a +replacer function is specified, or optionally including only the specified +properties if a replacer array is specified. + +#### Syntax + JSON5.stringify(value[, replacer[, space]]) + JSON5.stringify(value[, options]) + +#### Parameters +- `value`: The value to convert to a JSON5 string. +- `replacer`: A function that alters the behavior of the stringification + process, or an array of String and Number objects that serve as a whitelist + for selecting/filtering the properties of the value object to be included in + the JSON5 string. If this value is null or not provided, all properties of the + object are included in the resulting JSON5 string. +- `space`: A String or Number object that's used to insert white space into the + output JSON5 string for readability purposes. If this is a Number, it + indicates the number of space characters to use as white space; this number is + capped at 10 (if it is greater, the value is just 10). Values less than 1 + indicate that no space should be used. If this is a String, the string (or the + first 10 characters of the string, if it's longer than that) is used as white + space. If this parameter is not provided (or is null), no white space is used. + If white space is used, trailing commas will be used in objects and arrays. +- `options`: An object with the following properties: + - `replacer`: Same as the `replacer` parameter. + - `space`: Same as the `space` parameter. + - `quote`: A String representing the quote character to use when serializing + strings. + +#### Return value +A JSON5 string representing the value. + +### Node.js `require()` JSON5 files +When using Node.js, you can `require()` JSON5 files by adding the following +statement. + +```js +require('json5/lib/register') +``` + +Then you can load a JSON5 file with a Node.js `require()` statement. For +example: + +```js +const config = require('./config.json5') +``` + +## CLI +Since JSON is more widely used than JSON5, this package includes a CLI for +converting JSON5 to JSON and for validating the syntax of JSON5 documents. + +### Installation +```sh +npm install --global json5 +``` + +### Usage +```sh +json5 [options] +``` + +If `` is not provided, then STDIN is used. + +#### Options: +- `-s`, `--space`: The number of spaces to indent or `t` for tabs +- `-o`, `--out-file [file]`: Output to the specified file, otherwise STDOUT +- `-v`, `--validate`: Validate JSON5 but do not output JSON +- `-V`, `--version`: Output the version number +- `-h`, `--help`: Output usage information + +## Contributing +### Development +```sh +git clone https://github.com/json5/json5 +cd json5 +npm install +``` + +When contributing code, please write relevant tests and run `npm test` and `npm +run lint` before submitting pull requests. Please use an editor that supports +[EditorConfig](http://editorconfig.org/). + +### Issues +To report bugs or request features regarding the JSON5 data format, please +submit an issue to the [official specification +repository](https://github.com/json5/json5-spec). + +To report bugs or request features regarding the JavaScript implementation of +JSON5, please submit an issue to this repository. + +## License +MIT. See [LICENSE.md](./LICENSE.md) for details. + +## Credits +[Assem Kishore](https://github.com/aseemk) founded this project. + +[Michael Bolin](http://bolinfest.com/) independently arrived at and published +some of these same ideas with awesome explanations and detail. Recommended +reading: [Suggested Improvements to JSON](http://bolinfest.com/essays/json.html) + +[Douglas Crockford](http://www.crockford.com/) of course designed and built +JSON, but his state machine diagrams on the [JSON website](http://json.org/), as +cheesy as it may sound, gave us motivation and confidence that building a new +parser to implement these ideas was within reach! The original +implementation of JSON5 was also modeled directly off of Doug’s open-source +[json_parse.js] parser. We’re grateful for that clean and well-documented +code. + +[json_parse.js]: +https://github.com/douglascrockford/JSON-js/blob/03157639c7a7cddd2e9f032537f346f1a87c0f6d/json_parse.js + +[Max Nanasy](https://github.com/MaxNanasy) has been an early and prolific +supporter, contributing multiple patches and ideas. + +[Andrew Eisenberg](https://github.com/aeisenberg) contributed the original +`stringify` method. + +[Jordan Tucker](https://github.com/jordanbtucker) has aligned JSON5 more closely +with ES5, wrote the official JSON5 specification, completely rewrote the +codebase from the ground up, and is actively maintaining this project. diff --git a/tools/node_modules/@babel/core/node_modules/json5/dist/index.js b/tools/node_modules/@babel/core/node_modules/json5/dist/index.js new file mode 100644 index 00000000000000..9f98eb39da13fe --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/dist/index.js @@ -0,0 +1,1710 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.JSON5 = factory()); +}(this, (function () { 'use strict'; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var _global = createCommonjsModule(function (module) { + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); + if (typeof __g == 'number') { __g = global; } // eslint-disable-line no-undef + }); + + var _core = createCommonjsModule(function (module) { + var core = module.exports = { version: '2.6.5' }; + if (typeof __e == 'number') { __e = core; } // eslint-disable-line no-undef + }); + var _core_1 = _core.version; + + var _isObject = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + + var _anObject = function (it) { + if (!_isObject(it)) { throw TypeError(it + ' is not an object!'); } + return it; + }; + + var _fails = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } + }; + + // Thank's IE8 for his funny defineProperty + var _descriptors = !_fails(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; + }); + + var document = _global.document; + // typeof document.createElement is 'object' in old IE + var is = _isObject(document) && _isObject(document.createElement); + var _domCreate = function (it) { + return is ? document.createElement(it) : {}; + }; + + var _ie8DomDefine = !_descriptors && !_fails(function () { + return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; + }); + + // 7.1.1 ToPrimitive(input [, PreferredType]) + + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + var _toPrimitive = function (it, S) { + if (!_isObject(it)) { return it; } + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; } + if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) { return val; } + if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; } + throw TypeError("Can't convert object to primitive value"); + }; + + var dP = Object.defineProperty; + + var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { + _anObject(O); + P = _toPrimitive(P, true); + _anObject(Attributes); + if (_ie8DomDefine) { try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } } + if ('get' in Attributes || 'set' in Attributes) { throw TypeError('Accessors not supported!'); } + if ('value' in Attributes) { O[P] = Attributes.value; } + return O; + }; + + var _objectDp = { + f: f + }; + + var _propertyDesc = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; + }; + + var _hide = _descriptors ? function (object, key, value) { + return _objectDp.f(object, key, _propertyDesc(1, value)); + } : function (object, key, value) { + object[key] = value; + return object; + }; + + var hasOwnProperty = {}.hasOwnProperty; + var _has = function (it, key) { + return hasOwnProperty.call(it, key); + }; + + var id = 0; + var px = Math.random(); + var _uid = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); + }; + + var _library = false; + + var _shared = createCommonjsModule(function (module) { + var SHARED = '__core-js_shared__'; + var store = _global[SHARED] || (_global[SHARED] = {}); + + (module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); + })('versions', []).push({ + version: _core.version, + mode: _library ? 'pure' : 'global', + copyright: '© 2019 Denis Pushkarev (zloirock.ru)' + }); + }); + + var _functionToString = _shared('native-function-to-string', Function.toString); + + var _redefine = createCommonjsModule(function (module) { + var SRC = _uid('src'); + + var TO_STRING = 'toString'; + var TPL = ('' + _functionToString).split(TO_STRING); + + _core.inspectSource = function (it) { + return _functionToString.call(it); + }; + + (module.exports = function (O, key, val, safe) { + var isFunction = typeof val == 'function'; + if (isFunction) { _has(val, 'name') || _hide(val, 'name', key); } + if (O[key] === val) { return; } + if (isFunction) { _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); } + if (O === _global) { + O[key] = val; + } else if (!safe) { + delete O[key]; + _hide(O, key, val); + } else if (O[key]) { + O[key] = val; + } else { + _hide(O, key, val); + } + // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative + })(Function.prototype, TO_STRING, function toString() { + return typeof this == 'function' && this[SRC] || _functionToString.call(this); + }); + }); + + var _aFunction = function (it) { + if (typeof it != 'function') { throw TypeError(it + ' is not a function!'); } + return it; + }; + + // optional / simple context binding + + var _ctx = function (fn, that, length) { + _aFunction(fn); + if (that === undefined) { return fn; } + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; + }; + + var PROTOTYPE = 'prototype'; + + var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) { source = name; } + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; + // extend global + if (target) { _redefine(target, key, out, type & $export.U); } + // export + if (exports[key] != out) { _hide(exports, key, exp); } + if (IS_PROTO && expProto[key] != out) { expProto[key] = out; } + } + }; + _global.core = _core; + // type bitmap + $export.F = 1; // forced + $export.G = 2; // global + $export.S = 4; // static + $export.P = 8; // proto + $export.B = 16; // bind + $export.W = 32; // wrap + $export.U = 64; // safe + $export.R = 128; // real proto method for `library` + var _export = $export; + + // 7.1.4 ToInteger + var ceil = Math.ceil; + var floor = Math.floor; + var _toInteger = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + }; + + // 7.2.1 RequireObjectCoercible(argument) + var _defined = function (it) { + if (it == undefined) { throw TypeError("Can't call method on " + it); } + return it; + }; + + // true -> String#at + // false -> String#codePointAt + var _stringAt = function (TO_STRING) { + return function (that, pos) { + var s = String(_defined(that)); + var i = _toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) { return TO_STRING ? '' : undefined; } + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; + }; + + var $at = _stringAt(false); + _export(_export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos) { + return $at(this, pos); + } + }); + + var codePointAt = _core.String.codePointAt; + + var max = Math.max; + var min = Math.min; + var _toAbsoluteIndex = function (index, length) { + index = _toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); + }; + + var fromCharCode = String.fromCharCode; + var $fromCodePoint = String.fromCodePoint; + + // length should be 1, old FF problem + _export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x) { + var arguments$1 = arguments; + // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { + code = +arguments$1[i++]; + if (_toAbsoluteIndex(code, 0x10ffff) !== code) { throw RangeError(code + ' is not a valid code point'); } + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } + }); + + var fromCodePoint = _core.String.fromCodePoint; + + // This is a generated file. Do not edit. + var Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/; + var ID_Start = /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u1877\u1880-\u1884\u1887-\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/; + var ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/; + + var unicode = { + Space_Separator: Space_Separator, + ID_Start: ID_Start, + ID_Continue: ID_Continue + }; + + var util = { + isSpaceSeparator: function isSpaceSeparator (c) { + return typeof c === 'string' && unicode.Space_Separator.test(c) + }, + + isIdStartChar: function isIdStartChar (c) { + return typeof c === 'string' && ( + (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c === '$') || (c === '_') || + unicode.ID_Start.test(c) + ) + }, + + isIdContinueChar: function isIdContinueChar (c) { + return typeof c === 'string' && ( + (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c >= '0' && c <= '9') || + (c === '$') || (c === '_') || + (c === '\u200C') || (c === '\u200D') || + unicode.ID_Continue.test(c) + ) + }, + + isDigit: function isDigit (c) { + return typeof c === 'string' && /[0-9]/.test(c) + }, + + isHexDigit: function isHexDigit (c) { + return typeof c === 'string' && /[0-9A-Fa-f]/.test(c) + }, + }; + + var source; + var parseState; + var stack; + var pos; + var line; + var column; + var token; + var key; + var root; + + var parse = function parse (text, reviver) { + source = String(text); + parseState = 'start'; + stack = []; + pos = 0; + line = 1; + column = 0; + token = undefined; + key = undefined; + root = undefined; + + do { + token = lex(); + + // This code is unreachable. + // if (!parseStates[parseState]) { + // throw invalidParseState() + // } + + parseStates[parseState](); + } while (token.type !== 'eof') + + if (typeof reviver === 'function') { + return internalize({'': root}, '', reviver) + } + + return root + }; + + function internalize (holder, name, reviver) { + var value = holder[name]; + if (value != null && typeof value === 'object') { + for (var key in value) { + var replacement = internalize(value, key, reviver); + if (replacement === undefined) { + delete value[key]; + } else { + value[key] = replacement; + } + } + } + + return reviver.call(holder, name, value) + } + + var lexState; + var buffer; + var doubleQuote; + var sign; + var c; + + function lex () { + lexState = 'default'; + buffer = ''; + doubleQuote = false; + sign = 1; + + for (;;) { + c = peek(); + + // This code is unreachable. + // if (!lexStates[lexState]) { + // throw invalidLexState(lexState) + // } + + var token = lexStates[lexState](); + if (token) { + return token + } + } + } + + function peek () { + if (source[pos]) { + return String.fromCodePoint(source.codePointAt(pos)) + } + } + + function read () { + var c = peek(); + + if (c === '\n') { + line++; + column = 0; + } else if (c) { + column += c.length; + } else { + column++; + } + + if (c) { + pos += c.length; + } + + return c + } + + var lexStates = { + default: function default$1 () { + switch (c) { + case '\t': + case '\v': + case '\f': + case ' ': + case '\u00A0': + case '\uFEFF': + case '\n': + case '\r': + case '\u2028': + case '\u2029': + read(); + return + + case '/': + read(); + lexState = 'comment'; + return + + case undefined: + read(); + return newToken('eof') + } + + if (util.isSpaceSeparator(c)) { + read(); + return + } + + // This code is unreachable. + // if (!lexStates[parseState]) { + // throw invalidLexState(parseState) + // } + + return lexStates[parseState]() + }, + + comment: function comment () { + switch (c) { + case '*': + read(); + lexState = 'multiLineComment'; + return + + case '/': + read(); + lexState = 'singleLineComment'; + return + } + + throw invalidChar(read()) + }, + + multiLineComment: function multiLineComment () { + switch (c) { + case '*': + read(); + lexState = 'multiLineCommentAsterisk'; + return + + case undefined: + throw invalidChar(read()) + } + + read(); + }, + + multiLineCommentAsterisk: function multiLineCommentAsterisk () { + switch (c) { + case '*': + read(); + return + + case '/': + read(); + lexState = 'default'; + return + + case undefined: + throw invalidChar(read()) + } + + read(); + lexState = 'multiLineComment'; + }, + + singleLineComment: function singleLineComment () { + switch (c) { + case '\n': + case '\r': + case '\u2028': + case '\u2029': + read(); + lexState = 'default'; + return + + case undefined: + read(); + return newToken('eof') + } + + read(); + }, + + value: function value () { + switch (c) { + case '{': + case '[': + return newToken('punctuator', read()) + + case 'n': + read(); + literal('ull'); + return newToken('null', null) + + case 't': + read(); + literal('rue'); + return newToken('boolean', true) + + case 'f': + read(); + literal('alse'); + return newToken('boolean', false) + + case '-': + case '+': + if (read() === '-') { + sign = -1; + } + + lexState = 'sign'; + return + + case '.': + buffer = read(); + lexState = 'decimalPointLeading'; + return + + case '0': + buffer = read(); + lexState = 'zero'; + return + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + buffer = read(); + lexState = 'decimalInteger'; + return + + case 'I': + read(); + literal('nfinity'); + return newToken('numeric', Infinity) + + case 'N': + read(); + literal('aN'); + return newToken('numeric', NaN) + + case '"': + case "'": + doubleQuote = (read() === '"'); + buffer = ''; + lexState = 'string'; + return + } + + throw invalidChar(read()) + }, + + identifierNameStartEscape: function identifierNameStartEscape () { + if (c !== 'u') { + throw invalidChar(read()) + } + + read(); + var u = unicodeEscape(); + switch (u) { + case '$': + case '_': + break + + default: + if (!util.isIdStartChar(u)) { + throw invalidIdentifier() + } + + break + } + + buffer += u; + lexState = 'identifierName'; + }, + + identifierName: function identifierName () { + switch (c) { + case '$': + case '_': + case '\u200C': + case '\u200D': + buffer += read(); + return + + case '\\': + read(); + lexState = 'identifierNameEscape'; + return + } + + if (util.isIdContinueChar(c)) { + buffer += read(); + return + } + + return newToken('identifier', buffer) + }, + + identifierNameEscape: function identifierNameEscape () { + if (c !== 'u') { + throw invalidChar(read()) + } + + read(); + var u = unicodeEscape(); + switch (u) { + case '$': + case '_': + case '\u200C': + case '\u200D': + break + + default: + if (!util.isIdContinueChar(u)) { + throw invalidIdentifier() + } + + break + } + + buffer += u; + lexState = 'identifierName'; + }, + + sign: function sign$1 () { + switch (c) { + case '.': + buffer = read(); + lexState = 'decimalPointLeading'; + return + + case '0': + buffer = read(); + lexState = 'zero'; + return + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + buffer = read(); + lexState = 'decimalInteger'; + return + + case 'I': + read(); + literal('nfinity'); + return newToken('numeric', sign * Infinity) + + case 'N': + read(); + literal('aN'); + return newToken('numeric', NaN) + } + + throw invalidChar(read()) + }, + + zero: function zero () { + switch (c) { + case '.': + buffer += read(); + lexState = 'decimalPoint'; + return + + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + + case 'x': + case 'X': + buffer += read(); + lexState = 'hexadecimal'; + return + } + + return newToken('numeric', sign * 0) + }, + + decimalInteger: function decimalInteger () { + switch (c) { + case '.': + buffer += read(); + lexState = 'decimalPoint'; + return + + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalPointLeading: function decimalPointLeading () { + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalFraction'; + return + } + + throw invalidChar(read()) + }, + + decimalPoint: function decimalPoint () { + switch (c) { + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalFraction'; + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalFraction: function decimalFraction () { + switch (c) { + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalExponent: function decimalExponent () { + switch (c) { + case '+': + case '-': + buffer += read(); + lexState = 'decimalExponentSign'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalExponentInteger'; + return + } + + throw invalidChar(read()) + }, + + decimalExponentSign: function decimalExponentSign () { + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalExponentInteger'; + return + } + + throw invalidChar(read()) + }, + + decimalExponentInteger: function decimalExponentInteger () { + if (util.isDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + hexadecimal: function hexadecimal () { + if (util.isHexDigit(c)) { + buffer += read(); + lexState = 'hexadecimalInteger'; + return + } + + throw invalidChar(read()) + }, + + hexadecimalInteger: function hexadecimalInteger () { + if (util.isHexDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + string: function string () { + switch (c) { + case '\\': + read(); + buffer += escape(); + return + + case '"': + if (doubleQuote) { + read(); + return newToken('string', buffer) + } + + buffer += read(); + return + + case "'": + if (!doubleQuote) { + read(); + return newToken('string', buffer) + } + + buffer += read(); + return + + case '\n': + case '\r': + throw invalidChar(read()) + + case '\u2028': + case '\u2029': + separatorChar(c); + break + + case undefined: + throw invalidChar(read()) + } + + buffer += read(); + }, + + start: function start () { + switch (c) { + case '{': + case '[': + return newToken('punctuator', read()) + + // This code is unreachable since the default lexState handles eof. + // case undefined: + // return newToken('eof') + } + + lexState = 'value'; + }, + + beforePropertyName: function beforePropertyName () { + switch (c) { + case '$': + case '_': + buffer = read(); + lexState = 'identifierName'; + return + + case '\\': + read(); + lexState = 'identifierNameStartEscape'; + return + + case '}': + return newToken('punctuator', read()) + + case '"': + case "'": + doubleQuote = (read() === '"'); + lexState = 'string'; + return + } + + if (util.isIdStartChar(c)) { + buffer += read(); + lexState = 'identifierName'; + return + } + + throw invalidChar(read()) + }, + + afterPropertyName: function afterPropertyName () { + if (c === ':') { + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + beforePropertyValue: function beforePropertyValue () { + lexState = 'value'; + }, + + afterPropertyValue: function afterPropertyValue () { + switch (c) { + case ',': + case '}': + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + beforeArrayValue: function beforeArrayValue () { + if (c === ']') { + return newToken('punctuator', read()) + } + + lexState = 'value'; + }, + + afterArrayValue: function afterArrayValue () { + switch (c) { + case ',': + case ']': + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + end: function end () { + // This code is unreachable since it's handled by the default lexState. + // if (c === undefined) { + // read() + // return newToken('eof') + // } + + throw invalidChar(read()) + }, + }; + + function newToken (type, value) { + return { + type: type, + value: value, + line: line, + column: column, + } + } + + function literal (s) { + for (var i = 0, list = s; i < list.length; i += 1) { + var c = list[i]; + + var p = peek(); + + if (p !== c) { + throw invalidChar(read()) + } + + read(); + } + } + + function escape () { + var c = peek(); + switch (c) { + case 'b': + read(); + return '\b' + + case 'f': + read(); + return '\f' + + case 'n': + read(); + return '\n' + + case 'r': + read(); + return '\r' + + case 't': + read(); + return '\t' + + case 'v': + read(); + return '\v' + + case '0': + read(); + if (util.isDigit(peek())) { + throw invalidChar(read()) + } + + return '\0' + + case 'x': + read(); + return hexEscape() + + case 'u': + read(); + return unicodeEscape() + + case '\n': + case '\u2028': + case '\u2029': + read(); + return '' + + case '\r': + read(); + if (peek() === '\n') { + read(); + } + + return '' + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + throw invalidChar(read()) + + case undefined: + throw invalidChar(read()) + } + + return read() + } + + function hexEscape () { + var buffer = ''; + var c = peek(); + + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read(); + + c = peek(); + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read(); + + return String.fromCodePoint(parseInt(buffer, 16)) + } + + function unicodeEscape () { + var buffer = ''; + var count = 4; + + while (count-- > 0) { + var c = peek(); + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read(); + } + + return String.fromCodePoint(parseInt(buffer, 16)) + } + + var parseStates = { + start: function start () { + if (token.type === 'eof') { + throw invalidEOF() + } + + push(); + }, + + beforePropertyName: function beforePropertyName () { + switch (token.type) { + case 'identifier': + case 'string': + key = token.value; + parseState = 'afterPropertyName'; + return + + case 'punctuator': + // This code is unreachable since it's handled by the lexState. + // if (token.value !== '}') { + // throw invalidToken() + // } + + pop(); + return + + case 'eof': + throw invalidEOF() + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + afterPropertyName: function afterPropertyName () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator' || token.value !== ':') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + parseState = 'beforePropertyValue'; + }, + + beforePropertyValue: function beforePropertyValue () { + if (token.type === 'eof') { + throw invalidEOF() + } + + push(); + }, + + beforeArrayValue: function beforeArrayValue () { + if (token.type === 'eof') { + throw invalidEOF() + } + + if (token.type === 'punctuator' && token.value === ']') { + pop(); + return + } + + push(); + }, + + afterPropertyValue: function afterPropertyValue () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + switch (token.value) { + case ',': + parseState = 'beforePropertyName'; + return + + case '}': + pop(); + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + afterArrayValue: function afterArrayValue () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + switch (token.value) { + case ',': + parseState = 'beforeArrayValue'; + return + + case ']': + pop(); + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + end: function end () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'eof') { + // throw invalidToken() + // } + }, + }; + + function push () { + var value; + + switch (token.type) { + case 'punctuator': + switch (token.value) { + case '{': + value = {}; + break + + case '[': + value = []; + break + } + + break + + case 'null': + case 'boolean': + case 'numeric': + case 'string': + value = token.value; + break + + // This code is unreachable. + // default: + // throw invalidToken() + } + + if (root === undefined) { + root = value; + } else { + var parent = stack[stack.length - 1]; + if (Array.isArray(parent)) { + parent.push(value); + } else { + parent[key] = value; + } + } + + if (value !== null && typeof value === 'object') { + stack.push(value); + + if (Array.isArray(value)) { + parseState = 'beforeArrayValue'; + } else { + parseState = 'beforePropertyName'; + } + } else { + var current = stack[stack.length - 1]; + if (current == null) { + parseState = 'end'; + } else if (Array.isArray(current)) { + parseState = 'afterArrayValue'; + } else { + parseState = 'afterPropertyValue'; + } + } + } + + function pop () { + stack.pop(); + + var current = stack[stack.length - 1]; + if (current == null) { + parseState = 'end'; + } else if (Array.isArray(current)) { + parseState = 'afterArrayValue'; + } else { + parseState = 'afterPropertyValue'; + } + } + + // This code is unreachable. + // function invalidParseState () { + // return new Error(`JSON5: invalid parse state '${parseState}'`) + // } + + // This code is unreachable. + // function invalidLexState (state) { + // return new Error(`JSON5: invalid lex state '${state}'`) + // } + + function invalidChar (c) { + if (c === undefined) { + return syntaxError(("JSON5: invalid end of input at " + line + ":" + column)) + } + + return syntaxError(("JSON5: invalid character '" + (formatChar(c)) + "' at " + line + ":" + column)) + } + + function invalidEOF () { + return syntaxError(("JSON5: invalid end of input at " + line + ":" + column)) + } + + // This code is unreachable. + // function invalidToken () { + // if (token.type === 'eof') { + // return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) + // } + + // const c = String.fromCodePoint(token.value.codePointAt(0)) + // return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) + // } + + function invalidIdentifier () { + column -= 5; + return syntaxError(("JSON5: invalid identifier character at " + line + ":" + column)) + } + + function separatorChar (c) { + console.warn(("JSON5: '" + (formatChar(c)) + "' in strings is not valid ECMAScript; consider escaping")); + } + + function formatChar (c) { + var replacements = { + "'": "\\'", + '"': '\\"', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t', + '\v': '\\v', + '\0': '\\0', + '\u2028': '\\u2028', + '\u2029': '\\u2029', + }; + + if (replacements[c]) { + return replacements[c] + } + + if (c < ' ') { + var hexString = c.charCodeAt(0).toString(16); + return '\\x' + ('00' + hexString).substring(hexString.length) + } + + return c + } + + function syntaxError (message) { + var err = new SyntaxError(message); + err.lineNumber = line; + err.columnNumber = column; + return err + } + + var stringify = function stringify (value, replacer, space) { + var stack = []; + var indent = ''; + var propertyList; + var replacerFunc; + var gap = ''; + var quote; + + if ( + replacer != null && + typeof replacer === 'object' && + !Array.isArray(replacer) + ) { + space = replacer.space; + quote = replacer.quote; + replacer = replacer.replacer; + } + + if (typeof replacer === 'function') { + replacerFunc = replacer; + } else if (Array.isArray(replacer)) { + propertyList = []; + for (var i = 0, list = replacer; i < list.length; i += 1) { + var v = list[i]; + + var item = (void 0); + + if (typeof v === 'string') { + item = v; + } else if ( + typeof v === 'number' || + v instanceof String || + v instanceof Number + ) { + item = String(v); + } + + if (item !== undefined && propertyList.indexOf(item) < 0) { + propertyList.push(item); + } + } + } + + if (space instanceof Number) { + space = Number(space); + } else if (space instanceof String) { + space = String(space); + } + + if (typeof space === 'number') { + if (space > 0) { + space = Math.min(10, Math.floor(space)); + gap = ' '.substr(0, space); + } + } else if (typeof space === 'string') { + gap = space.substr(0, 10); + } + + return serializeProperty('', {'': value}) + + function serializeProperty (key, holder) { + var value = holder[key]; + if (value != null) { + if (typeof value.toJSON5 === 'function') { + value = value.toJSON5(key); + } else if (typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + } + + if (replacerFunc) { + value = replacerFunc.call(holder, key, value); + } + + if (value instanceof Number) { + value = Number(value); + } else if (value instanceof String) { + value = String(value); + } else if (value instanceof Boolean) { + value = value.valueOf(); + } + + switch (value) { + case null: return 'null' + case true: return 'true' + case false: return 'false' + } + + if (typeof value === 'string') { + return quoteString(value, false) + } + + if (typeof value === 'number') { + return String(value) + } + + if (typeof value === 'object') { + return Array.isArray(value) ? serializeArray(value) : serializeObject(value) + } + + return undefined + } + + function quoteString (value) { + var quotes = { + "'": 0.1, + '"': 0.2, + }; + + var replacements = { + "'": "\\'", + '"': '\\"', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t', + '\v': '\\v', + '\0': '\\0', + '\u2028': '\\u2028', + '\u2029': '\\u2029', + }; + + var product = ''; + + for (var i = 0; i < value.length; i++) { + var c = value[i]; + switch (c) { + case "'": + case '"': + quotes[c]++; + product += c; + continue + + case '\0': + if (util.isDigit(value[i + 1])) { + product += '\\x00'; + continue + } + } + + if (replacements[c]) { + product += replacements[c]; + continue + } + + if (c < ' ') { + var hexString = c.charCodeAt(0).toString(16); + product += '\\x' + ('00' + hexString).substring(hexString.length); + continue + } + + product += c; + } + + var quoteChar = quote || Object.keys(quotes).reduce(function (a, b) { return (quotes[a] < quotes[b]) ? a : b; }); + + product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]); + + return quoteChar + product + quoteChar + } + + function serializeObject (value) { + if (stack.indexOf(value) >= 0) { + throw TypeError('Converting circular structure to JSON5') + } + + stack.push(value); + + var stepback = indent; + indent = indent + gap; + + var keys = propertyList || Object.keys(value); + var partial = []; + for (var i = 0, list = keys; i < list.length; i += 1) { + var key = list[i]; + + var propertyString = serializeProperty(key, value); + if (propertyString !== undefined) { + var member = serializeKey(key) + ':'; + if (gap !== '') { + member += ' '; + } + member += propertyString; + partial.push(member); + } + } + + var final; + if (partial.length === 0) { + final = '{}'; + } else { + var properties; + if (gap === '') { + properties = partial.join(','); + final = '{' + properties + '}'; + } else { + var separator = ',\n' + indent; + properties = partial.join(separator); + final = '{\n' + indent + properties + ',\n' + stepback + '}'; + } + } + + stack.pop(); + indent = stepback; + return final + } + + function serializeKey (key) { + if (key.length === 0) { + return quoteString(key, true) + } + + var firstChar = String.fromCodePoint(key.codePointAt(0)); + if (!util.isIdStartChar(firstChar)) { + return quoteString(key, true) + } + + for (var i = firstChar.length; i < key.length; i++) { + if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { + return quoteString(key, true) + } + } + + return key + } + + function serializeArray (value) { + if (stack.indexOf(value) >= 0) { + throw TypeError('Converting circular structure to JSON5') + } + + stack.push(value); + + var stepback = indent; + indent = indent + gap; + + var partial = []; + for (var i = 0; i < value.length; i++) { + var propertyString = serializeProperty(String(i), value); + partial.push((propertyString !== undefined) ? propertyString : 'null'); + } + + var final; + if (partial.length === 0) { + final = '[]'; + } else { + if (gap === '') { + var properties = partial.join(','); + final = '[' + properties + ']'; + } else { + var separator = ',\n' + indent; + var properties$1 = partial.join(separator); + final = '[\n' + indent + properties$1 + ',\n' + stepback + ']'; + } + } + + stack.pop(); + indent = stepback; + return final + } + }; + + var JSON5 = { + parse: parse, + stringify: stringify, + }; + + var lib = JSON5; + + var es5 = lib; + + return es5; + +}))); diff --git a/tools/node_modules/@babel/core/node_modules/json5/dist/index.min.js b/tools/node_modules/@babel/core/node_modules/json5/dist/index.min.js new file mode 100644 index 00000000000000..da63a9da38f4dc --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/dist/index.min.js @@ -0,0 +1 @@ +!function(u,D){"object"==typeof exports&&"undefined"!=typeof module?module.exports=D():"function"==typeof define&&define.amd?define(D):u.JSON5=D()}(this,function(){"use strict";function u(u,D){return u(D={exports:{}},D.exports),D.exports}var D=u(function(u){var D=u.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=D)}),e=u(function(u){var D=u.exports={version:"2.6.5"};"number"==typeof __e&&(__e=D)}),t=(e.version,function(u){return"object"==typeof u?null!==u:"function"==typeof u}),r=function(u){if(!t(u))throw TypeError(u+" is not an object!");return u},F=function(u){try{return!!u()}catch(u){return!0}},n=!F(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),C=D.document,A=t(C)&&t(C.createElement),i=!n&&!F(function(){return 7!=Object.defineProperty((u="div",A?C.createElement(u):{}),"a",{get:function(){return 7}}).a;var u}),E=Object.defineProperty,o={f:n?Object.defineProperty:function(u,D,e){if(r(u),D=function(u,D){if(!t(u))return u;var e,r;if(D&&"function"==typeof(e=u.toString)&&!t(r=e.call(u)))return r;if("function"==typeof(e=u.valueOf)&&!t(r=e.call(u)))return r;if(!D&&"function"==typeof(e=u.toString)&&!t(r=e.call(u)))return r;throw TypeError("Can't convert object to primitive value")}(D,!0),r(e),i)try{return E(u,D,e)}catch(u){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(u[D]=e.value),u}},a=n?function(u,D,e){return o.f(u,D,function(u,D){return{enumerable:!(1&u),configurable:!(2&u),writable:!(4&u),value:D}}(1,e))}:function(u,D,e){return u[D]=e,u},c={}.hasOwnProperty,B=function(u,D){return c.call(u,D)},s=0,f=Math.random(),l=u(function(u){var t=D["__core-js_shared__"]||(D["__core-js_shared__"]={});(u.exports=function(u,D){return t[u]||(t[u]=void 0!==D?D:{})})("versions",[]).push({version:e.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})("native-function-to-string",Function.toString),d=u(function(u){var t,r="Symbol(".concat(void 0===(t="src")?"":t,")_",(++s+f).toString(36)),F=(""+l).split("toString");e.inspectSource=function(u){return l.call(u)},(u.exports=function(u,e,t,n){var C="function"==typeof t;C&&(B(t,"name")||a(t,"name",e)),u[e]!==t&&(C&&(B(t,r)||a(t,r,u[e]?""+u[e]:F.join(String(e)))),u===D?u[e]=t:n?u[e]?u[e]=t:a(u,e,t):(delete u[e],a(u,e,t)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[r]||l.call(this)})}),v=function(u,D,e){if(function(u){if("function"!=typeof u)throw TypeError(u+" is not a function!")}(u),void 0===D)return u;switch(e){case 1:return function(e){return u.call(D,e)};case 2:return function(e,t){return u.call(D,e,t)};case 3:return function(e,t,r){return u.call(D,e,t,r)}}return function(){return u.apply(D,arguments)}},p=function(u,t,r){var F,n,C,A,i=u&p.F,E=u&p.G,o=u&p.S,c=u&p.P,B=u&p.B,s=E?D:o?D[t]||(D[t]={}):(D[t]||{}).prototype,f=E?e:e[t]||(e[t]={}),l=f.prototype||(f.prototype={});for(F in E&&(r=t),r)C=((n=!i&&s&&void 0!==s[F])?s:r)[F],A=B&&n?v(C,D):c&&"function"==typeof C?v(Function.call,C):C,s&&d(s,F,C,u&p.U),f[F]!=C&&a(f,F,A),c&&l[F]!=C&&(l[F]=C)};D.core=e,p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128;var h,m=p,g=Math.ceil,y=Math.floor,w=function(u){return isNaN(u=+u)?0:(u>0?y:g)(u)},S=(h=!1,function(u,D){var e,t,r=String(function(u){if(null==u)throw TypeError("Can't call method on "+u);return u}(u)),F=w(D),n=r.length;return F<0||F>=n?h?"":void 0:(e=r.charCodeAt(F))<55296||e>56319||F+1===n||(t=r.charCodeAt(F+1))<56320||t>57343?h?r.charAt(F):e:h?r.slice(F,F+2):t-56320+(e-55296<<10)+65536});m(m.P,"String",{codePointAt:function(u){return S(this,u)}});e.String.codePointAt;var b=Math.max,x=Math.min,N=String.fromCharCode,P=String.fromCodePoint;m(m.S+m.F*(!!P&&1!=P.length),"String",{fromCodePoint:function(u){for(var D,e,t,r=arguments,F=[],n=arguments.length,C=0;n>C;){if(D=+r[C++],t=1114111,((e=w(e=D))<0?b(e+t,0):x(e,t))!==D)throw RangeError(D+" is not a valid code point");F.push(D<65536?N(D):N(55296+((D-=65536)>>10),D%1024+56320))}return F.join("")}});e.String.fromCodePoint;var _,I,O,j,V,J,M,k,L,T,z,H,$,R,G={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u1877\u1880-\u1884\u1887-\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},U={isSpaceSeparator:function(u){return"string"==typeof u&&G.Space_Separator.test(u)},isIdStartChar:function(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||G.ID_Start.test(u))},isIdContinueChar:function(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||G.ID_Continue.test(u))},isDigit:function(u){return"string"==typeof u&&/[0-9]/.test(u)},isHexDigit:function(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};function Z(){for(T="default",z="",H=!1,$=1;;){R=q();var u=X[T]();if(u)return u}}function q(){if(_[j])return String.fromCodePoint(_.codePointAt(j))}function W(){var u=q();return"\n"===u?(V++,J=0):u?J+=u.length:J++,u&&(j+=u.length),u}var X={default:function(){switch(R){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void W();case"/":return W(),void(T="comment");case void 0:return W(),K("eof")}if(!U.isSpaceSeparator(R))return X[I]();W()},comment:function(){switch(R){case"*":return W(),void(T="multiLineComment");case"/":return W(),void(T="singleLineComment")}throw tu(W())},multiLineComment:function(){switch(R){case"*":return W(),void(T="multiLineCommentAsterisk");case void 0:throw tu(W())}W()},multiLineCommentAsterisk:function(){switch(R){case"*":return void W();case"/":return W(),void(T="default");case void 0:throw tu(W())}W(),T="multiLineComment"},singleLineComment:function(){switch(R){case"\n":case"\r":case"\u2028":case"\u2029":return W(),void(T="default");case void 0:return W(),K("eof")}W()},value:function(){switch(R){case"{":case"[":return K("punctuator",W());case"n":return W(),Q("ull"),K("null",null);case"t":return W(),Q("rue"),K("boolean",!0);case"f":return W(),Q("alse"),K("boolean",!1);case"-":case"+":return"-"===W()&&($=-1),void(T="sign");case".":return z=W(),void(T="decimalPointLeading");case"0":return z=W(),void(T="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return z=W(),void(T="decimalInteger");case"I":return W(),Q("nfinity"),K("numeric",1/0);case"N":return W(),Q("aN"),K("numeric",NaN);case'"':case"'":return H='"'===W(),z="",void(T="string")}throw tu(W())},identifierNameStartEscape:function(){if("u"!==R)throw tu(W());W();var u=Y();switch(u){case"$":case"_":break;default:if(!U.isIdStartChar(u))throw Fu()}z+=u,T="identifierName"},identifierName:function(){switch(R){case"$":case"_":case"‌":case"‍":return void(z+=W());case"\\":return W(),void(T="identifierNameEscape")}if(!U.isIdContinueChar(R))return K("identifier",z);z+=W()},identifierNameEscape:function(){if("u"!==R)throw tu(W());W();var u=Y();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!U.isIdContinueChar(u))throw Fu()}z+=u,T="identifierName"},sign:function(){switch(R){case".":return z=W(),void(T="decimalPointLeading");case"0":return z=W(),void(T="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return z=W(),void(T="decimalInteger");case"I":return W(),Q("nfinity"),K("numeric",$*(1/0));case"N":return W(),Q("aN"),K("numeric",NaN)}throw tu(W())},zero:function(){switch(R){case".":return z+=W(),void(T="decimalPoint");case"e":case"E":return z+=W(),void(T="decimalExponent");case"x":case"X":return z+=W(),void(T="hexadecimal")}return K("numeric",0*$)},decimalInteger:function(){switch(R){case".":return z+=W(),void(T="decimalPoint");case"e":case"E":return z+=W(),void(T="decimalExponent")}if(!U.isDigit(R))return K("numeric",$*Number(z));z+=W()},decimalPointLeading:function(){if(U.isDigit(R))return z+=W(),void(T="decimalFraction");throw tu(W())},decimalPoint:function(){switch(R){case"e":case"E":return z+=W(),void(T="decimalExponent")}return U.isDigit(R)?(z+=W(),void(T="decimalFraction")):K("numeric",$*Number(z))},decimalFraction:function(){switch(R){case"e":case"E":return z+=W(),void(T="decimalExponent")}if(!U.isDigit(R))return K("numeric",$*Number(z));z+=W()},decimalExponent:function(){switch(R){case"+":case"-":return z+=W(),void(T="decimalExponentSign")}if(U.isDigit(R))return z+=W(),void(T="decimalExponentInteger");throw tu(W())},decimalExponentSign:function(){if(U.isDigit(R))return z+=W(),void(T="decimalExponentInteger");throw tu(W())},decimalExponentInteger:function(){if(!U.isDigit(R))return K("numeric",$*Number(z));z+=W()},hexadecimal:function(){if(U.isHexDigit(R))return z+=W(),void(T="hexadecimalInteger");throw tu(W())},hexadecimalInteger:function(){if(!U.isHexDigit(R))return K("numeric",$*Number(z));z+=W()},string:function(){switch(R){case"\\":return W(),void(z+=function(){switch(q()){case"b":return W(),"\b";case"f":return W(),"\f";case"n":return W(),"\n";case"r":return W(),"\r";case"t":return W(),"\t";case"v":return W(),"\v";case"0":if(W(),U.isDigit(q()))throw tu(W());return"\0";case"x":return W(),function(){var u="",D=q();if(!U.isHexDigit(D))throw tu(W());if(u+=W(),D=q(),!U.isHexDigit(D))throw tu(W());return u+=W(),String.fromCodePoint(parseInt(u,16))}();case"u":return W(),Y();case"\n":case"\u2028":case"\u2029":return W(),"";case"\r":return W(),"\n"===q()&&W(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw tu(W())}return W()}());case'"':return H?(W(),K("string",z)):void(z+=W());case"'":return H?void(z+=W()):(W(),K("string",z));case"\n":case"\r":throw tu(W());case"\u2028":case"\u2029":!function(u){console.warn("JSON5: '"+nu(u)+"' in strings is not valid ECMAScript; consider escaping")}(R);break;case void 0:throw tu(W())}z+=W()},start:function(){switch(R){case"{":case"[":return K("punctuator",W())}T="value"},beforePropertyName:function(){switch(R){case"$":case"_":return z=W(),void(T="identifierName");case"\\":return W(),void(T="identifierNameStartEscape");case"}":return K("punctuator",W());case'"':case"'":return H='"'===W(),void(T="string")}if(U.isIdStartChar(R))return z+=W(),void(T="identifierName");throw tu(W())},afterPropertyName:function(){if(":"===R)return K("punctuator",W());throw tu(W())},beforePropertyValue:function(){T="value"},afterPropertyValue:function(){switch(R){case",":case"}":return K("punctuator",W())}throw tu(W())},beforeArrayValue:function(){if("]"===R)return K("punctuator",W());T="value"},afterArrayValue:function(){switch(R){case",":case"]":return K("punctuator",W())}throw tu(W())},end:function(){throw tu(W())}};function K(u,D){return{type:u,value:D,line:V,column:J}}function Q(u){for(var D=0,e=u;D0;){var e=q();if(!U.isHexDigit(e))throw tu(W());u+=W()}return String.fromCodePoint(parseInt(u,16))}var uu={start:function(){if("eof"===M.type)throw ru();Du()},beforePropertyName:function(){switch(M.type){case"identifier":case"string":return k=M.value,void(I="afterPropertyName");case"punctuator":return void eu();case"eof":throw ru()}},afterPropertyName:function(){if("eof"===M.type)throw ru();I="beforePropertyValue"},beforePropertyValue:function(){if("eof"===M.type)throw ru();Du()},beforeArrayValue:function(){if("eof"===M.type)throw ru();"punctuator"!==M.type||"]"!==M.value?Du():eu()},afterPropertyValue:function(){if("eof"===M.type)throw ru();switch(M.value){case",":return void(I="beforePropertyName");case"}":eu()}},afterArrayValue:function(){if("eof"===M.type)throw ru();switch(M.value){case",":return void(I="beforeArrayValue");case"]":eu()}},end:function(){}};function Du(){var u;switch(M.type){case"punctuator":switch(M.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=M.value}if(void 0===L)L=u;else{var D=O[O.length-1];Array.isArray(D)?D.push(u):D[k]=u}if(null!==u&&"object"==typeof u)O.push(u),I=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{var e=O[O.length-1];I=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}}function eu(){O.pop();var u=O[O.length-1];I=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function tu(u){return Cu(void 0===u?"JSON5: invalid end of input at "+V+":"+J:"JSON5: invalid character '"+nu(u)+"' at "+V+":"+J)}function ru(){return Cu("JSON5: invalid end of input at "+V+":"+J)}function Fu(){return Cu("JSON5: invalid identifier character at "+V+":"+(J-=5))}function nu(u){var D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){var e=u.charCodeAt(0).toString(16);return"\\x"+("00"+e).substring(e.length)}return u}function Cu(u){var D=new SyntaxError(u);return D.lineNumber=V,D.columnNumber=J,D}return{parse:function(u,D){_=String(u),I="start",O=[],j=0,V=1,J=0,M=void 0,k=void 0,L=void 0;do{M=Z(),uu[I]()}while("eof"!==M.type);return"function"==typeof D?function u(D,e,t){var r=D[e];if(null!=r&&"object"==typeof r)for(var F in r){var n=u(r,F,t);void 0===n?delete r[F]:r[F]=n}return t.call(D,e,r)}({"":L},"",D):L},stringify:function(u,D,e){var t,r,F,n=[],C="",A="";if(null==D||"object"!=typeof D||Array.isArray(D)||(e=D.space,F=D.quote,D=D.replacer),"function"==typeof D)r=D;else if(Array.isArray(D)){t=[];for(var i=0,E=D;i0&&(e=Math.min(10,Math.floor(e)),A=" ".substr(0,e)):"string"==typeof e&&(A=e.substr(0,10)),c("",{"":u});function c(u,D){var e=D[u];switch(null!=e&&("function"==typeof e.toJSON5?e=e.toJSON5(u):"function"==typeof e.toJSON&&(e=e.toJSON(u))),r&&(e=r.call(D,u,e)),e instanceof Number?e=Number(e):e instanceof String?e=String(e):e instanceof Boolean&&(e=e.valueOf()),e){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof e?B(e):"number"==typeof e?String(e):"object"==typeof e?Array.isArray(e)?function(u){if(n.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");n.push(u);var D=C;C+=A;for(var e,t=[],r=0;r=0)throw TypeError("Converting circular structure to JSON5");n.push(u);var D=C;C+=A;for(var e,r,F=t||Object.keys(u),i=[],E=0,o=F;E"string"==typeof u&&unicode.Space_Separator.test(u),isIdStartChar:u=>"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||unicode.ID_Start.test(u)),isIdContinueChar:u=>"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||unicode.ID_Continue.test(u)),isDigit:u=>"string"==typeof u&&/[0-9]/.test(u),isHexDigit:u=>"string"==typeof u&&/[0-9A-Fa-f]/.test(u)};let source,parseState,stack,pos,line,column,token,key,root;var parse=function(u,D){source=String(u),parseState="start",stack=[],pos=0,line=1,column=0,token=void 0,key=void 0,root=void 0;do{token=lex(),parseStates[parseState]()}while("eof"!==token.type);return"function"==typeof D?internalize({"":root},"",D):root};function internalize(u,D,e){const r=u[D];if(null!=r&&"object"==typeof r)for(const u in r){const D=internalize(r,u,e);void 0===D?delete r[u]:r[u]=D}return e.call(u,D,r)}let lexState,buffer,doubleQuote,sign,c;function lex(){for(lexState="default",buffer="",doubleQuote=!1,sign=1;;){c=peek();const u=lexStates[lexState]();if(u)return u}}function peek(){if(source[pos])return String.fromCodePoint(source.codePointAt(pos))}function read(){const u=peek();return"\n"===u?(line++,column=0):u?column+=u.length:column++,u&&(pos+=u.length),u}const lexStates={default(){switch(c){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void read();case"/":return read(),void(lexState="comment");case void 0:return read(),newToken("eof")}if(!util.isSpaceSeparator(c))return lexStates[parseState]();read()},comment(){switch(c){case"*":return read(),void(lexState="multiLineComment");case"/":return read(),void(lexState="singleLineComment")}throw invalidChar(read())},multiLineComment(){switch(c){case"*":return read(),void(lexState="multiLineCommentAsterisk");case void 0:throw invalidChar(read())}read()},multiLineCommentAsterisk(){switch(c){case"*":return void read();case"/":return read(),void(lexState="default");case void 0:throw invalidChar(read())}read(),lexState="multiLineComment"},singleLineComment(){switch(c){case"\n":case"\r":case"\u2028":case"\u2029":return read(),void(lexState="default");case void 0:return read(),newToken("eof")}read()},value(){switch(c){case"{":case"[":return newToken("punctuator",read());case"n":return read(),literal("ull"),newToken("null",null);case"t":return read(),literal("rue"),newToken("boolean",!0);case"f":return read(),literal("alse"),newToken("boolean",!1);case"-":case"+":return"-"===read()&&(sign=-1),void(lexState="sign");case".":return buffer=read(),void(lexState="decimalPointLeading");case"0":return buffer=read(),void(lexState="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return buffer=read(),void(lexState="decimalInteger");case"I":return read(),literal("nfinity"),newToken("numeric",1/0);case"N":return read(),literal("aN"),newToken("numeric",NaN);case'"':case"'":return doubleQuote='"'===read(),buffer="",void(lexState="string")}throw invalidChar(read())},identifierNameStartEscape(){if("u"!==c)throw invalidChar(read());read();const u=unicodeEscape();switch(u){case"$":case"_":break;default:if(!util.isIdStartChar(u))throw invalidIdentifier()}buffer+=u,lexState="identifierName"},identifierName(){switch(c){case"$":case"_":case"‌":case"‍":return void(buffer+=read());case"\\":return read(),void(lexState="identifierNameEscape")}if(!util.isIdContinueChar(c))return newToken("identifier",buffer);buffer+=read()},identifierNameEscape(){if("u"!==c)throw invalidChar(read());read();const u=unicodeEscape();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!util.isIdContinueChar(u))throw invalidIdentifier()}buffer+=u,lexState="identifierName"},sign(){switch(c){case".":return buffer=read(),void(lexState="decimalPointLeading");case"0":return buffer=read(),void(lexState="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return buffer=read(),void(lexState="decimalInteger");case"I":return read(),literal("nfinity"),newToken("numeric",sign*(1/0));case"N":return read(),literal("aN"),newToken("numeric",NaN)}throw invalidChar(read())},zero(){switch(c){case".":return buffer+=read(),void(lexState="decimalPoint");case"e":case"E":return buffer+=read(),void(lexState="decimalExponent");case"x":case"X":return buffer+=read(),void(lexState="hexadecimal")}return newToken("numeric",0*sign)},decimalInteger(){switch(c){case".":return buffer+=read(),void(lexState="decimalPoint");case"e":case"E":return buffer+=read(),void(lexState="decimalExponent")}if(!util.isDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},decimalPointLeading(){if(util.isDigit(c))return buffer+=read(),void(lexState="decimalFraction");throw invalidChar(read())},decimalPoint(){switch(c){case"e":case"E":return buffer+=read(),void(lexState="decimalExponent")}return util.isDigit(c)?(buffer+=read(),void(lexState="decimalFraction")):newToken("numeric",sign*Number(buffer))},decimalFraction(){switch(c){case"e":case"E":return buffer+=read(),void(lexState="decimalExponent")}if(!util.isDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},decimalExponent(){switch(c){case"+":case"-":return buffer+=read(),void(lexState="decimalExponentSign")}if(util.isDigit(c))return buffer+=read(),void(lexState="decimalExponentInteger");throw invalidChar(read())},decimalExponentSign(){if(util.isDigit(c))return buffer+=read(),void(lexState="decimalExponentInteger");throw invalidChar(read())},decimalExponentInteger(){if(!util.isDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},hexadecimal(){if(util.isHexDigit(c))return buffer+=read(),void(lexState="hexadecimalInteger");throw invalidChar(read())},hexadecimalInteger(){if(!util.isHexDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},string(){switch(c){case"\\":return read(),void(buffer+=escape());case'"':return doubleQuote?(read(),newToken("string",buffer)):void(buffer+=read());case"'":return doubleQuote?void(buffer+=read()):(read(),newToken("string",buffer));case"\n":case"\r":throw invalidChar(read());case"\u2028":case"\u2029":separatorChar(c);break;case void 0:throw invalidChar(read())}buffer+=read()},start(){switch(c){case"{":case"[":return newToken("punctuator",read())}lexState="value"},beforePropertyName(){switch(c){case"$":case"_":return buffer=read(),void(lexState="identifierName");case"\\":return read(),void(lexState="identifierNameStartEscape");case"}":return newToken("punctuator",read());case'"':case"'":return doubleQuote='"'===read(),void(lexState="string")}if(util.isIdStartChar(c))return buffer+=read(),void(lexState="identifierName");throw invalidChar(read())},afterPropertyName(){if(":"===c)return newToken("punctuator",read());throw invalidChar(read())},beforePropertyValue(){lexState="value"},afterPropertyValue(){switch(c){case",":case"}":return newToken("punctuator",read())}throw invalidChar(read())},beforeArrayValue(){if("]"===c)return newToken("punctuator",read());lexState="value"},afterArrayValue(){switch(c){case",":case"]":return newToken("punctuator",read())}throw invalidChar(read())},end(){throw invalidChar(read())}};function newToken(u,D){return{type:u,value:D,line:line,column:column}}function literal(u){for(const D of u){if(peek()!==D)throw invalidChar(read());read()}}function escape(){switch(peek()){case"b":return read(),"\b";case"f":return read(),"\f";case"n":return read(),"\n";case"r":return read(),"\r";case"t":return read(),"\t";case"v":return read(),"\v";case"0":if(read(),util.isDigit(peek()))throw invalidChar(read());return"\0";case"x":return read(),hexEscape();case"u":return read(),unicodeEscape();case"\n":case"\u2028":case"\u2029":return read(),"";case"\r":return read(),"\n"===peek()&&read(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw invalidChar(read())}return read()}function hexEscape(){let u="",D=peek();if(!util.isHexDigit(D))throw invalidChar(read());if(u+=read(),D=peek(),!util.isHexDigit(D))throw invalidChar(read());return u+=read(),String.fromCodePoint(parseInt(u,16))}function unicodeEscape(){let u="",D=4;for(;D-- >0;){const D=peek();if(!util.isHexDigit(D))throw invalidChar(read());u+=read()}return String.fromCodePoint(parseInt(u,16))}const parseStates={start(){if("eof"===token.type)throw invalidEOF();push()},beforePropertyName(){switch(token.type){case"identifier":case"string":return key=token.value,void(parseState="afterPropertyName");case"punctuator":return void pop();case"eof":throw invalidEOF()}},afterPropertyName(){if("eof"===token.type)throw invalidEOF();parseState="beforePropertyValue"},beforePropertyValue(){if("eof"===token.type)throw invalidEOF();push()},beforeArrayValue(){if("eof"===token.type)throw invalidEOF();"punctuator"!==token.type||"]"!==token.value?push():pop()},afterPropertyValue(){if("eof"===token.type)throw invalidEOF();switch(token.value){case",":return void(parseState="beforePropertyName");case"}":pop()}},afterArrayValue(){if("eof"===token.type)throw invalidEOF();switch(token.value){case",":return void(parseState="beforeArrayValue");case"]":pop()}},end(){}};function push(){let u;switch(token.type){case"punctuator":switch(token.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=token.value}if(void 0===root)root=u;else{const D=stack[stack.length-1];Array.isArray(D)?D.push(u):D[key]=u}if(null!==u&&"object"==typeof u)stack.push(u),parseState=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=stack[stack.length-1];parseState=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}}function pop(){stack.pop();const u=stack[stack.length-1];parseState=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function invalidChar(u){return syntaxError(void 0===u?`JSON5: invalid end of input at ${line}:${column}`:`JSON5: invalid character '${formatChar(u)}' at ${line}:${column}`)}function invalidEOF(){return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)}function invalidIdentifier(){return syntaxError(`JSON5: invalid identifier character at ${line}:${column-=5}`)}function separatorChar(u){console.warn(`JSON5: '${formatChar(u)}' in strings is not valid ECMAScript; consider escaping`)}function formatChar(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const D=u.charCodeAt(0).toString(16);return"\\x"+("00"+D).substring(D.length)}return u}function syntaxError(u){const D=new SyntaxError(u);return D.lineNumber=line,D.columnNumber=column,D}var stringify=function(u,D,e){const r=[];let t,F,C,a="",A="";if(null==D||"object"!=typeof D||Array.isArray(D)||(e=D.space,C=D.quote,D=D.replacer),"function"==typeof D)F=D;else if(Array.isArray(D)){t=[];for(const u of D){let D;"string"==typeof u?D=u:("number"==typeof u||u instanceof String||u instanceof Number)&&(D=String(u)),void 0!==D&&t.indexOf(D)<0&&t.push(D)}}return e instanceof Number?e=Number(e):e instanceof String&&(e=String(e)),"number"==typeof e?e>0&&(e=Math.min(10,Math.floor(e)),A=" ".substr(0,e)):"string"==typeof e&&(A=e.substr(0,10)),E("",{"":u});function E(u,D){let e=D[u];switch(null!=e&&("function"==typeof e.toJSON5?e=e.toJSON5(u):"function"==typeof e.toJSON&&(e=e.toJSON(u))),F&&(e=F.call(D,u,e)),e instanceof Number?e=Number(e):e instanceof String?e=String(e):e instanceof Boolean&&(e=e.valueOf()),e){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof e?n(e):"number"==typeof e?String(e):"object"==typeof e?Array.isArray(e)?function(u){if(r.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let D=a;a+=A;let e,t=[];for(let D=0;D=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let D=a;a+=A;let e,F=t||Object.keys(u),C=[];for(const D of F){const e=E(D,u);if(void 0!==e){let u=i(D)+":";""!==A&&(u+=" "),u+=e,C.push(u)}}if(0===C.length)e="{}";else{let u;if(""===A)u=C.join(","),e="{"+u+"}";else{let r=",\n"+a;u=C.join(r),e="{\n"+a+u+",\n"+D+"}"}}return r.pop(),a=D,e}(e):void 0}function n(u){const D={"'":.1,'"':.2},e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let r="";for(let t=0;tD[u]= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c === '$') || (c === '_') || + unicode.ID_Start.test(c) + ) + }, + + isIdContinueChar (c) { + return typeof c === 'string' && ( + (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c >= '0' && c <= '9') || + (c === '$') || (c === '_') || + (c === '\u200C') || (c === '\u200D') || + unicode.ID_Continue.test(c) + ) + }, + + isDigit (c) { + return typeof c === 'string' && /[0-9]/.test(c) + }, + + isHexDigit (c) { + return typeof c === 'string' && /[0-9A-Fa-f]/.test(c) + }, +}; + +let source; +let parseState; +let stack; +let pos; +let line; +let column; +let token; +let key; +let root; + +var parse = function parse (text, reviver) { + source = String(text); + parseState = 'start'; + stack = []; + pos = 0; + line = 1; + column = 0; + token = undefined; + key = undefined; + root = undefined; + + do { + token = lex(); + + // This code is unreachable. + // if (!parseStates[parseState]) { + // throw invalidParseState() + // } + + parseStates[parseState](); + } while (token.type !== 'eof') + + if (typeof reviver === 'function') { + return internalize({'': root}, '', reviver) + } + + return root +}; + +function internalize (holder, name, reviver) { + const value = holder[name]; + if (value != null && typeof value === 'object') { + for (const key in value) { + const replacement = internalize(value, key, reviver); + if (replacement === undefined) { + delete value[key]; + } else { + value[key] = replacement; + } + } + } + + return reviver.call(holder, name, value) +} + +let lexState; +let buffer; +let doubleQuote; +let sign; +let c; + +function lex () { + lexState = 'default'; + buffer = ''; + doubleQuote = false; + sign = 1; + + for (;;) { + c = peek(); + + // This code is unreachable. + // if (!lexStates[lexState]) { + // throw invalidLexState(lexState) + // } + + const token = lexStates[lexState](); + if (token) { + return token + } + } +} + +function peek () { + if (source[pos]) { + return String.fromCodePoint(source.codePointAt(pos)) + } +} + +function read () { + const c = peek(); + + if (c === '\n') { + line++; + column = 0; + } else if (c) { + column += c.length; + } else { + column++; + } + + if (c) { + pos += c.length; + } + + return c +} + +const lexStates = { + default () { + switch (c) { + case '\t': + case '\v': + case '\f': + case ' ': + case '\u00A0': + case '\uFEFF': + case '\n': + case '\r': + case '\u2028': + case '\u2029': + read(); + return + + case '/': + read(); + lexState = 'comment'; + return + + case undefined: + read(); + return newToken('eof') + } + + if (util.isSpaceSeparator(c)) { + read(); + return + } + + // This code is unreachable. + // if (!lexStates[parseState]) { + // throw invalidLexState(parseState) + // } + + return lexStates[parseState]() + }, + + comment () { + switch (c) { + case '*': + read(); + lexState = 'multiLineComment'; + return + + case '/': + read(); + lexState = 'singleLineComment'; + return + } + + throw invalidChar(read()) + }, + + multiLineComment () { + switch (c) { + case '*': + read(); + lexState = 'multiLineCommentAsterisk'; + return + + case undefined: + throw invalidChar(read()) + } + + read(); + }, + + multiLineCommentAsterisk () { + switch (c) { + case '*': + read(); + return + + case '/': + read(); + lexState = 'default'; + return + + case undefined: + throw invalidChar(read()) + } + + read(); + lexState = 'multiLineComment'; + }, + + singleLineComment () { + switch (c) { + case '\n': + case '\r': + case '\u2028': + case '\u2029': + read(); + lexState = 'default'; + return + + case undefined: + read(); + return newToken('eof') + } + + read(); + }, + + value () { + switch (c) { + case '{': + case '[': + return newToken('punctuator', read()) + + case 'n': + read(); + literal('ull'); + return newToken('null', null) + + case 't': + read(); + literal('rue'); + return newToken('boolean', true) + + case 'f': + read(); + literal('alse'); + return newToken('boolean', false) + + case '-': + case '+': + if (read() === '-') { + sign = -1; + } + + lexState = 'sign'; + return + + case '.': + buffer = read(); + lexState = 'decimalPointLeading'; + return + + case '0': + buffer = read(); + lexState = 'zero'; + return + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + buffer = read(); + lexState = 'decimalInteger'; + return + + case 'I': + read(); + literal('nfinity'); + return newToken('numeric', Infinity) + + case 'N': + read(); + literal('aN'); + return newToken('numeric', NaN) + + case '"': + case "'": + doubleQuote = (read() === '"'); + buffer = ''; + lexState = 'string'; + return + } + + throw invalidChar(read()) + }, + + identifierNameStartEscape () { + if (c !== 'u') { + throw invalidChar(read()) + } + + read(); + const u = unicodeEscape(); + switch (u) { + case '$': + case '_': + break + + default: + if (!util.isIdStartChar(u)) { + throw invalidIdentifier() + } + + break + } + + buffer += u; + lexState = 'identifierName'; + }, + + identifierName () { + switch (c) { + case '$': + case '_': + case '\u200C': + case '\u200D': + buffer += read(); + return + + case '\\': + read(); + lexState = 'identifierNameEscape'; + return + } + + if (util.isIdContinueChar(c)) { + buffer += read(); + return + } + + return newToken('identifier', buffer) + }, + + identifierNameEscape () { + if (c !== 'u') { + throw invalidChar(read()) + } + + read(); + const u = unicodeEscape(); + switch (u) { + case '$': + case '_': + case '\u200C': + case '\u200D': + break + + default: + if (!util.isIdContinueChar(u)) { + throw invalidIdentifier() + } + + break + } + + buffer += u; + lexState = 'identifierName'; + }, + + sign () { + switch (c) { + case '.': + buffer = read(); + lexState = 'decimalPointLeading'; + return + + case '0': + buffer = read(); + lexState = 'zero'; + return + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + buffer = read(); + lexState = 'decimalInteger'; + return + + case 'I': + read(); + literal('nfinity'); + return newToken('numeric', sign * Infinity) + + case 'N': + read(); + literal('aN'); + return newToken('numeric', NaN) + } + + throw invalidChar(read()) + }, + + zero () { + switch (c) { + case '.': + buffer += read(); + lexState = 'decimalPoint'; + return + + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + + case 'x': + case 'X': + buffer += read(); + lexState = 'hexadecimal'; + return + } + + return newToken('numeric', sign * 0) + }, + + decimalInteger () { + switch (c) { + case '.': + buffer += read(); + lexState = 'decimalPoint'; + return + + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalPointLeading () { + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalFraction'; + return + } + + throw invalidChar(read()) + }, + + decimalPoint () { + switch (c) { + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalFraction'; + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalFraction () { + switch (c) { + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalExponent () { + switch (c) { + case '+': + case '-': + buffer += read(); + lexState = 'decimalExponentSign'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalExponentInteger'; + return + } + + throw invalidChar(read()) + }, + + decimalExponentSign () { + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalExponentInteger'; + return + } + + throw invalidChar(read()) + }, + + decimalExponentInteger () { + if (util.isDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + hexadecimal () { + if (util.isHexDigit(c)) { + buffer += read(); + lexState = 'hexadecimalInteger'; + return + } + + throw invalidChar(read()) + }, + + hexadecimalInteger () { + if (util.isHexDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + string () { + switch (c) { + case '\\': + read(); + buffer += escape(); + return + + case '"': + if (doubleQuote) { + read(); + return newToken('string', buffer) + } + + buffer += read(); + return + + case "'": + if (!doubleQuote) { + read(); + return newToken('string', buffer) + } + + buffer += read(); + return + + case '\n': + case '\r': + throw invalidChar(read()) + + case '\u2028': + case '\u2029': + separatorChar(c); + break + + case undefined: + throw invalidChar(read()) + } + + buffer += read(); + }, + + start () { + switch (c) { + case '{': + case '[': + return newToken('punctuator', read()) + + // This code is unreachable since the default lexState handles eof. + // case undefined: + // return newToken('eof') + } + + lexState = 'value'; + }, + + beforePropertyName () { + switch (c) { + case '$': + case '_': + buffer = read(); + lexState = 'identifierName'; + return + + case '\\': + read(); + lexState = 'identifierNameStartEscape'; + return + + case '}': + return newToken('punctuator', read()) + + case '"': + case "'": + doubleQuote = (read() === '"'); + lexState = 'string'; + return + } + + if (util.isIdStartChar(c)) { + buffer += read(); + lexState = 'identifierName'; + return + } + + throw invalidChar(read()) + }, + + afterPropertyName () { + if (c === ':') { + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + beforePropertyValue () { + lexState = 'value'; + }, + + afterPropertyValue () { + switch (c) { + case ',': + case '}': + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + beforeArrayValue () { + if (c === ']') { + return newToken('punctuator', read()) + } + + lexState = 'value'; + }, + + afterArrayValue () { + switch (c) { + case ',': + case ']': + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + end () { + // This code is unreachable since it's handled by the default lexState. + // if (c === undefined) { + // read() + // return newToken('eof') + // } + + throw invalidChar(read()) + }, +}; + +function newToken (type, value) { + return { + type, + value, + line, + column, + } +} + +function literal (s) { + for (const c of s) { + const p = peek(); + + if (p !== c) { + throw invalidChar(read()) + } + + read(); + } +} + +function escape () { + const c = peek(); + switch (c) { + case 'b': + read(); + return '\b' + + case 'f': + read(); + return '\f' + + case 'n': + read(); + return '\n' + + case 'r': + read(); + return '\r' + + case 't': + read(); + return '\t' + + case 'v': + read(); + return '\v' + + case '0': + read(); + if (util.isDigit(peek())) { + throw invalidChar(read()) + } + + return '\0' + + case 'x': + read(); + return hexEscape() + + case 'u': + read(); + return unicodeEscape() + + case '\n': + case '\u2028': + case '\u2029': + read(); + return '' + + case '\r': + read(); + if (peek() === '\n') { + read(); + } + + return '' + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + throw invalidChar(read()) + + case undefined: + throw invalidChar(read()) + } + + return read() +} + +function hexEscape () { + let buffer = ''; + let c = peek(); + + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read(); + + c = peek(); + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read(); + + return String.fromCodePoint(parseInt(buffer, 16)) +} + +function unicodeEscape () { + let buffer = ''; + let count = 4; + + while (count-- > 0) { + const c = peek(); + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read(); + } + + return String.fromCodePoint(parseInt(buffer, 16)) +} + +const parseStates = { + start () { + if (token.type === 'eof') { + throw invalidEOF() + } + + push(); + }, + + beforePropertyName () { + switch (token.type) { + case 'identifier': + case 'string': + key = token.value; + parseState = 'afterPropertyName'; + return + + case 'punctuator': + // This code is unreachable since it's handled by the lexState. + // if (token.value !== '}') { + // throw invalidToken() + // } + + pop(); + return + + case 'eof': + throw invalidEOF() + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + afterPropertyName () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator' || token.value !== ':') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + parseState = 'beforePropertyValue'; + }, + + beforePropertyValue () { + if (token.type === 'eof') { + throw invalidEOF() + } + + push(); + }, + + beforeArrayValue () { + if (token.type === 'eof') { + throw invalidEOF() + } + + if (token.type === 'punctuator' && token.value === ']') { + pop(); + return + } + + push(); + }, + + afterPropertyValue () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + switch (token.value) { + case ',': + parseState = 'beforePropertyName'; + return + + case '}': + pop(); + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + afterArrayValue () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + switch (token.value) { + case ',': + parseState = 'beforeArrayValue'; + return + + case ']': + pop(); + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + end () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'eof') { + // throw invalidToken() + // } + }, +}; + +function push () { + let value; + + switch (token.type) { + case 'punctuator': + switch (token.value) { + case '{': + value = {}; + break + + case '[': + value = []; + break + } + + break + + case 'null': + case 'boolean': + case 'numeric': + case 'string': + value = token.value; + break + + // This code is unreachable. + // default: + // throw invalidToken() + } + + if (root === undefined) { + root = value; + } else { + const parent = stack[stack.length - 1]; + if (Array.isArray(parent)) { + parent.push(value); + } else { + parent[key] = value; + } + } + + if (value !== null && typeof value === 'object') { + stack.push(value); + + if (Array.isArray(value)) { + parseState = 'beforeArrayValue'; + } else { + parseState = 'beforePropertyName'; + } + } else { + const current = stack[stack.length - 1]; + if (current == null) { + parseState = 'end'; + } else if (Array.isArray(current)) { + parseState = 'afterArrayValue'; + } else { + parseState = 'afterPropertyValue'; + } + } +} + +function pop () { + stack.pop(); + + const current = stack[stack.length - 1]; + if (current == null) { + parseState = 'end'; + } else if (Array.isArray(current)) { + parseState = 'afterArrayValue'; + } else { + parseState = 'afterPropertyValue'; + } +} + +// This code is unreachable. +// function invalidParseState () { +// return new Error(`JSON5: invalid parse state '${parseState}'`) +// } + +// This code is unreachable. +// function invalidLexState (state) { +// return new Error(`JSON5: invalid lex state '${state}'`) +// } + +function invalidChar (c) { + if (c === undefined) { + return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) + } + + return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) +} + +function invalidEOF () { + return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) +} + +// This code is unreachable. +// function invalidToken () { +// if (token.type === 'eof') { +// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) +// } + +// const c = String.fromCodePoint(token.value.codePointAt(0)) +// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) +// } + +function invalidIdentifier () { + column -= 5; + return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`) +} + +function separatorChar (c) { + console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`); +} + +function formatChar (c) { + const replacements = { + "'": "\\'", + '"': '\\"', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t', + '\v': '\\v', + '\0': '\\0', + '\u2028': '\\u2028', + '\u2029': '\\u2029', + }; + + if (replacements[c]) { + return replacements[c] + } + + if (c < ' ') { + const hexString = c.charCodeAt(0).toString(16); + return '\\x' + ('00' + hexString).substring(hexString.length) + } + + return c +} + +function syntaxError (message) { + const err = new SyntaxError(message); + err.lineNumber = line; + err.columnNumber = column; + return err +} + +var stringify = function stringify (value, replacer, space) { + const stack = []; + let indent = ''; + let propertyList; + let replacerFunc; + let gap = ''; + let quote; + + if ( + replacer != null && + typeof replacer === 'object' && + !Array.isArray(replacer) + ) { + space = replacer.space; + quote = replacer.quote; + replacer = replacer.replacer; + } + + if (typeof replacer === 'function') { + replacerFunc = replacer; + } else if (Array.isArray(replacer)) { + propertyList = []; + for (const v of replacer) { + let item; + + if (typeof v === 'string') { + item = v; + } else if ( + typeof v === 'number' || + v instanceof String || + v instanceof Number + ) { + item = String(v); + } + + if (item !== undefined && propertyList.indexOf(item) < 0) { + propertyList.push(item); + } + } + } + + if (space instanceof Number) { + space = Number(space); + } else if (space instanceof String) { + space = String(space); + } + + if (typeof space === 'number') { + if (space > 0) { + space = Math.min(10, Math.floor(space)); + gap = ' '.substr(0, space); + } + } else if (typeof space === 'string') { + gap = space.substr(0, 10); + } + + return serializeProperty('', {'': value}) + + function serializeProperty (key, holder) { + let value = holder[key]; + if (value != null) { + if (typeof value.toJSON5 === 'function') { + value = value.toJSON5(key); + } else if (typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + } + + if (replacerFunc) { + value = replacerFunc.call(holder, key, value); + } + + if (value instanceof Number) { + value = Number(value); + } else if (value instanceof String) { + value = String(value); + } else if (value instanceof Boolean) { + value = value.valueOf(); + } + + switch (value) { + case null: return 'null' + case true: return 'true' + case false: return 'false' + } + + if (typeof value === 'string') { + return quoteString(value, false) + } + + if (typeof value === 'number') { + return String(value) + } + + if (typeof value === 'object') { + return Array.isArray(value) ? serializeArray(value) : serializeObject(value) + } + + return undefined + } + + function quoteString (value) { + const quotes = { + "'": 0.1, + '"': 0.2, + }; + + const replacements = { + "'": "\\'", + '"': '\\"', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t', + '\v': '\\v', + '\0': '\\0', + '\u2028': '\\u2028', + '\u2029': '\\u2029', + }; + + let product = ''; + + for (let i = 0; i < value.length; i++) { + const c = value[i]; + switch (c) { + case "'": + case '"': + quotes[c]++; + product += c; + continue + + case '\0': + if (util.isDigit(value[i + 1])) { + product += '\\x00'; + continue + } + } + + if (replacements[c]) { + product += replacements[c]; + continue + } + + if (c < ' ') { + let hexString = c.charCodeAt(0).toString(16); + product += '\\x' + ('00' + hexString).substring(hexString.length); + continue + } + + product += c; + } + + const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b); + + product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]); + + return quoteChar + product + quoteChar + } + + function serializeObject (value) { + if (stack.indexOf(value) >= 0) { + throw TypeError('Converting circular structure to JSON5') + } + + stack.push(value); + + let stepback = indent; + indent = indent + gap; + + let keys = propertyList || Object.keys(value); + let partial = []; + for (const key of keys) { + const propertyString = serializeProperty(key, value); + if (propertyString !== undefined) { + let member = serializeKey(key) + ':'; + if (gap !== '') { + member += ' '; + } + member += propertyString; + partial.push(member); + } + } + + let final; + if (partial.length === 0) { + final = '{}'; + } else { + let properties; + if (gap === '') { + properties = partial.join(','); + final = '{' + properties + '}'; + } else { + let separator = ',\n' + indent; + properties = partial.join(separator); + final = '{\n' + indent + properties + ',\n' + stepback + '}'; + } + } + + stack.pop(); + indent = stepback; + return final + } + + function serializeKey (key) { + if (key.length === 0) { + return quoteString(key, true) + } + + const firstChar = String.fromCodePoint(key.codePointAt(0)); + if (!util.isIdStartChar(firstChar)) { + return quoteString(key, true) + } + + for (let i = firstChar.length; i < key.length; i++) { + if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { + return quoteString(key, true) + } + } + + return key + } + + function serializeArray (value) { + if (stack.indexOf(value) >= 0) { + throw TypeError('Converting circular structure to JSON5') + } + + stack.push(value); + + let stepback = indent; + indent = indent + gap; + + let partial = []; + for (let i = 0; i < value.length; i++) { + const propertyString = serializeProperty(String(i), value); + partial.push((propertyString !== undefined) ? propertyString : 'null'); + } + + let final; + if (partial.length === 0) { + final = '[]'; + } else { + if (gap === '') { + let properties = partial.join(','); + final = '[' + properties + ']'; + } else { + let separator = ',\n' + indent; + let properties = partial.join(separator); + final = '[\n' + indent + properties + ',\n' + stepback + ']'; + } + } + + stack.pop(); + indent = stepback; + return final + } +}; + +const JSON5 = { + parse, + stringify, +}; + +var lib = JSON5; + +export default lib; diff --git a/tools/node_modules/@babel/core/node_modules/json5/lib/cli.js b/tools/node_modules/@babel/core/node_modules/json5/lib/cli.js new file mode 100644 index 00000000000000..de852f15e47bc2 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/lib/cli.js @@ -0,0 +1,112 @@ +#!/usr/bin/env node + +const fs = require('fs') +const path = require('path') +const minimist = require('minimist') +const pkg = require('../package.json') +const JSON5 = require('./') + +const argv = minimist(process.argv.slice(2), { + alias: { + 'convert': 'c', + 'space': 's', + 'validate': 'v', + 'out-file': 'o', + 'version': 'V', + 'help': 'h', + }, + boolean: [ + 'convert', + 'validate', + 'version', + 'help', + ], + string: [ + 'space', + 'out-file', + ], +}) + +if (argv.version) { + version() +} else if (argv.help) { + usage() +} else { + const inFilename = argv._[0] + + let readStream + if (inFilename) { + readStream = fs.createReadStream(inFilename) + } else { + readStream = process.stdin + } + + let json5 = '' + readStream.on('data', data => { + json5 += data + }) + + readStream.on('end', () => { + let space + if (argv.space === 't' || argv.space === 'tab') { + space = '\t' + } else { + space = Number(argv.space) + } + + let value + try { + value = JSON5.parse(json5) + if (!argv.validate) { + const json = JSON.stringify(value, null, space) + + let writeStream + + // --convert is for backward compatibility with v0.5.1. If + // specified with and not --out-file, then a file with + // the same name but with a .json extension will be written. + if (argv.convert && inFilename && !argv.o) { + const parsedFilename = path.parse(inFilename) + const outFilename = path.format( + Object.assign( + parsedFilename, + {base: path.basename(parsedFilename.base, parsedFilename.ext) + '.json'} + ) + ) + + writeStream = fs.createWriteStream(outFilename) + } else if (argv.o) { + writeStream = fs.createWriteStream(argv.o) + } else { + writeStream = process.stdout + } + + writeStream.write(json) + } + } catch (err) { + console.error(err.message) + process.exit(1) + } + }) +} + +function version () { + console.log(pkg.version) +} + +function usage () { + console.log( + ` + Usage: json5 [options] + + If is not provided, then STDIN is used. + + Options: + + -s, --space The number of spaces to indent or 't' for tabs + -o, --out-file [file] Output to the specified file, otherwise STDOUT + -v, --validate Validate JSON5 but do not output JSON + -V, --version Output the version number + -h, --help Output usage information` + ) +} diff --git a/tools/node_modules/@babel/core/node_modules/json5/lib/index.js b/tools/node_modules/@babel/core/node_modules/json5/lib/index.js new file mode 100644 index 00000000000000..36796388892da3 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/lib/index.js @@ -0,0 +1,9 @@ +const parse = require('./parse') +const stringify = require('./stringify') + +const JSON5 = { + parse, + stringify, +} + +module.exports = JSON5 diff --git a/tools/node_modules/@babel/core/node_modules/json5/lib/parse.js b/tools/node_modules/@babel/core/node_modules/json5/lib/parse.js new file mode 100644 index 00000000000000..c01646fc3a9981 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/lib/parse.js @@ -0,0 +1,1087 @@ +const util = require('./util') + +let source +let parseState +let stack +let pos +let line +let column +let token +let key +let root + +module.exports = function parse (text, reviver) { + source = String(text) + parseState = 'start' + stack = [] + pos = 0 + line = 1 + column = 0 + token = undefined + key = undefined + root = undefined + + do { + token = lex() + + // This code is unreachable. + // if (!parseStates[parseState]) { + // throw invalidParseState() + // } + + parseStates[parseState]() + } while (token.type !== 'eof') + + if (typeof reviver === 'function') { + return internalize({'': root}, '', reviver) + } + + return root +} + +function internalize (holder, name, reviver) { + const value = holder[name] + if (value != null && typeof value === 'object') { + for (const key in value) { + const replacement = internalize(value, key, reviver) + if (replacement === undefined) { + delete value[key] + } else { + value[key] = replacement + } + } + } + + return reviver.call(holder, name, value) +} + +let lexState +let buffer +let doubleQuote +let sign +let c + +function lex () { + lexState = 'default' + buffer = '' + doubleQuote = false + sign = 1 + + for (;;) { + c = peek() + + // This code is unreachable. + // if (!lexStates[lexState]) { + // throw invalidLexState(lexState) + // } + + const token = lexStates[lexState]() + if (token) { + return token + } + } +} + +function peek () { + if (source[pos]) { + return String.fromCodePoint(source.codePointAt(pos)) + } +} + +function read () { + const c = peek() + + if (c === '\n') { + line++ + column = 0 + } else if (c) { + column += c.length + } else { + column++ + } + + if (c) { + pos += c.length + } + + return c +} + +const lexStates = { + default () { + switch (c) { + case '\t': + case '\v': + case '\f': + case ' ': + case '\u00A0': + case '\uFEFF': + case '\n': + case '\r': + case '\u2028': + case '\u2029': + read() + return + + case '/': + read() + lexState = 'comment' + return + + case undefined: + read() + return newToken('eof') + } + + if (util.isSpaceSeparator(c)) { + read() + return + } + + // This code is unreachable. + // if (!lexStates[parseState]) { + // throw invalidLexState(parseState) + // } + + return lexStates[parseState]() + }, + + comment () { + switch (c) { + case '*': + read() + lexState = 'multiLineComment' + return + + case '/': + read() + lexState = 'singleLineComment' + return + } + + throw invalidChar(read()) + }, + + multiLineComment () { + switch (c) { + case '*': + read() + lexState = 'multiLineCommentAsterisk' + return + + case undefined: + throw invalidChar(read()) + } + + read() + }, + + multiLineCommentAsterisk () { + switch (c) { + case '*': + read() + return + + case '/': + read() + lexState = 'default' + return + + case undefined: + throw invalidChar(read()) + } + + read() + lexState = 'multiLineComment' + }, + + singleLineComment () { + switch (c) { + case '\n': + case '\r': + case '\u2028': + case '\u2029': + read() + lexState = 'default' + return + + case undefined: + read() + return newToken('eof') + } + + read() + }, + + value () { + switch (c) { + case '{': + case '[': + return newToken('punctuator', read()) + + case 'n': + read() + literal('ull') + return newToken('null', null) + + case 't': + read() + literal('rue') + return newToken('boolean', true) + + case 'f': + read() + literal('alse') + return newToken('boolean', false) + + case '-': + case '+': + if (read() === '-') { + sign = -1 + } + + lexState = 'sign' + return + + case '.': + buffer = read() + lexState = 'decimalPointLeading' + return + + case '0': + buffer = read() + lexState = 'zero' + return + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + buffer = read() + lexState = 'decimalInteger' + return + + case 'I': + read() + literal('nfinity') + return newToken('numeric', Infinity) + + case 'N': + read() + literal('aN') + return newToken('numeric', NaN) + + case '"': + case "'": + doubleQuote = (read() === '"') + buffer = '' + lexState = 'string' + return + } + + throw invalidChar(read()) + }, + + identifierNameStartEscape () { + if (c !== 'u') { + throw invalidChar(read()) + } + + read() + const u = unicodeEscape() + switch (u) { + case '$': + case '_': + break + + default: + if (!util.isIdStartChar(u)) { + throw invalidIdentifier() + } + + break + } + + buffer += u + lexState = 'identifierName' + }, + + identifierName () { + switch (c) { + case '$': + case '_': + case '\u200C': + case '\u200D': + buffer += read() + return + + case '\\': + read() + lexState = 'identifierNameEscape' + return + } + + if (util.isIdContinueChar(c)) { + buffer += read() + return + } + + return newToken('identifier', buffer) + }, + + identifierNameEscape () { + if (c !== 'u') { + throw invalidChar(read()) + } + + read() + const u = unicodeEscape() + switch (u) { + case '$': + case '_': + case '\u200C': + case '\u200D': + break + + default: + if (!util.isIdContinueChar(u)) { + throw invalidIdentifier() + } + + break + } + + buffer += u + lexState = 'identifierName' + }, + + sign () { + switch (c) { + case '.': + buffer = read() + lexState = 'decimalPointLeading' + return + + case '0': + buffer = read() + lexState = 'zero' + return + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + buffer = read() + lexState = 'decimalInteger' + return + + case 'I': + read() + literal('nfinity') + return newToken('numeric', sign * Infinity) + + case 'N': + read() + literal('aN') + return newToken('numeric', NaN) + } + + throw invalidChar(read()) + }, + + zero () { + switch (c) { + case '.': + buffer += read() + lexState = 'decimalPoint' + return + + case 'e': + case 'E': + buffer += read() + lexState = 'decimalExponent' + return + + case 'x': + case 'X': + buffer += read() + lexState = 'hexadecimal' + return + } + + return newToken('numeric', sign * 0) + }, + + decimalInteger () { + switch (c) { + case '.': + buffer += read() + lexState = 'decimalPoint' + return + + case 'e': + case 'E': + buffer += read() + lexState = 'decimalExponent' + return + } + + if (util.isDigit(c)) { + buffer += read() + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalPointLeading () { + if (util.isDigit(c)) { + buffer += read() + lexState = 'decimalFraction' + return + } + + throw invalidChar(read()) + }, + + decimalPoint () { + switch (c) { + case 'e': + case 'E': + buffer += read() + lexState = 'decimalExponent' + return + } + + if (util.isDigit(c)) { + buffer += read() + lexState = 'decimalFraction' + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalFraction () { + switch (c) { + case 'e': + case 'E': + buffer += read() + lexState = 'decimalExponent' + return + } + + if (util.isDigit(c)) { + buffer += read() + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalExponent () { + switch (c) { + case '+': + case '-': + buffer += read() + lexState = 'decimalExponentSign' + return + } + + if (util.isDigit(c)) { + buffer += read() + lexState = 'decimalExponentInteger' + return + } + + throw invalidChar(read()) + }, + + decimalExponentSign () { + if (util.isDigit(c)) { + buffer += read() + lexState = 'decimalExponentInteger' + return + } + + throw invalidChar(read()) + }, + + decimalExponentInteger () { + if (util.isDigit(c)) { + buffer += read() + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + hexadecimal () { + if (util.isHexDigit(c)) { + buffer += read() + lexState = 'hexadecimalInteger' + return + } + + throw invalidChar(read()) + }, + + hexadecimalInteger () { + if (util.isHexDigit(c)) { + buffer += read() + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + string () { + switch (c) { + case '\\': + read() + buffer += escape() + return + + case '"': + if (doubleQuote) { + read() + return newToken('string', buffer) + } + + buffer += read() + return + + case "'": + if (!doubleQuote) { + read() + return newToken('string', buffer) + } + + buffer += read() + return + + case '\n': + case '\r': + throw invalidChar(read()) + + case '\u2028': + case '\u2029': + separatorChar(c) + break + + case undefined: + throw invalidChar(read()) + } + + buffer += read() + }, + + start () { + switch (c) { + case '{': + case '[': + return newToken('punctuator', read()) + + // This code is unreachable since the default lexState handles eof. + // case undefined: + // return newToken('eof') + } + + lexState = 'value' + }, + + beforePropertyName () { + switch (c) { + case '$': + case '_': + buffer = read() + lexState = 'identifierName' + return + + case '\\': + read() + lexState = 'identifierNameStartEscape' + return + + case '}': + return newToken('punctuator', read()) + + case '"': + case "'": + doubleQuote = (read() === '"') + lexState = 'string' + return + } + + if (util.isIdStartChar(c)) { + buffer += read() + lexState = 'identifierName' + return + } + + throw invalidChar(read()) + }, + + afterPropertyName () { + if (c === ':') { + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + beforePropertyValue () { + lexState = 'value' + }, + + afterPropertyValue () { + switch (c) { + case ',': + case '}': + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + beforeArrayValue () { + if (c === ']') { + return newToken('punctuator', read()) + } + + lexState = 'value' + }, + + afterArrayValue () { + switch (c) { + case ',': + case ']': + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + end () { + // This code is unreachable since it's handled by the default lexState. + // if (c === undefined) { + // read() + // return newToken('eof') + // } + + throw invalidChar(read()) + }, +} + +function newToken (type, value) { + return { + type, + value, + line, + column, + } +} + +function literal (s) { + for (const c of s) { + const p = peek() + + if (p !== c) { + throw invalidChar(read()) + } + + read() + } +} + +function escape () { + const c = peek() + switch (c) { + case 'b': + read() + return '\b' + + case 'f': + read() + return '\f' + + case 'n': + read() + return '\n' + + case 'r': + read() + return '\r' + + case 't': + read() + return '\t' + + case 'v': + read() + return '\v' + + case '0': + read() + if (util.isDigit(peek())) { + throw invalidChar(read()) + } + + return '\0' + + case 'x': + read() + return hexEscape() + + case 'u': + read() + return unicodeEscape() + + case '\n': + case '\u2028': + case '\u2029': + read() + return '' + + case '\r': + read() + if (peek() === '\n') { + read() + } + + return '' + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + throw invalidChar(read()) + + case undefined: + throw invalidChar(read()) + } + + return read() +} + +function hexEscape () { + let buffer = '' + let c = peek() + + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read() + + c = peek() + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read() + + return String.fromCodePoint(parseInt(buffer, 16)) +} + +function unicodeEscape () { + let buffer = '' + let count = 4 + + while (count-- > 0) { + const c = peek() + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read() + } + + return String.fromCodePoint(parseInt(buffer, 16)) +} + +const parseStates = { + start () { + if (token.type === 'eof') { + throw invalidEOF() + } + + push() + }, + + beforePropertyName () { + switch (token.type) { + case 'identifier': + case 'string': + key = token.value + parseState = 'afterPropertyName' + return + + case 'punctuator': + // This code is unreachable since it's handled by the lexState. + // if (token.value !== '}') { + // throw invalidToken() + // } + + pop() + return + + case 'eof': + throw invalidEOF() + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + afterPropertyName () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator' || token.value !== ':') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + parseState = 'beforePropertyValue' + }, + + beforePropertyValue () { + if (token.type === 'eof') { + throw invalidEOF() + } + + push() + }, + + beforeArrayValue () { + if (token.type === 'eof') { + throw invalidEOF() + } + + if (token.type === 'punctuator' && token.value === ']') { + pop() + return + } + + push() + }, + + afterPropertyValue () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + switch (token.value) { + case ',': + parseState = 'beforePropertyName' + return + + case '}': + pop() + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + afterArrayValue () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + switch (token.value) { + case ',': + parseState = 'beforeArrayValue' + return + + case ']': + pop() + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + end () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'eof') { + // throw invalidToken() + // } + }, +} + +function push () { + let value + + switch (token.type) { + case 'punctuator': + switch (token.value) { + case '{': + value = {} + break + + case '[': + value = [] + break + } + + break + + case 'null': + case 'boolean': + case 'numeric': + case 'string': + value = token.value + break + + // This code is unreachable. + // default: + // throw invalidToken() + } + + if (root === undefined) { + root = value + } else { + const parent = stack[stack.length - 1] + if (Array.isArray(parent)) { + parent.push(value) + } else { + parent[key] = value + } + } + + if (value !== null && typeof value === 'object') { + stack.push(value) + + if (Array.isArray(value)) { + parseState = 'beforeArrayValue' + } else { + parseState = 'beforePropertyName' + } + } else { + const current = stack[stack.length - 1] + if (current == null) { + parseState = 'end' + } else if (Array.isArray(current)) { + parseState = 'afterArrayValue' + } else { + parseState = 'afterPropertyValue' + } + } +} + +function pop () { + stack.pop() + + const current = stack[stack.length - 1] + if (current == null) { + parseState = 'end' + } else if (Array.isArray(current)) { + parseState = 'afterArrayValue' + } else { + parseState = 'afterPropertyValue' + } +} + +// This code is unreachable. +// function invalidParseState () { +// return new Error(`JSON5: invalid parse state '${parseState}'`) +// } + +// This code is unreachable. +// function invalidLexState (state) { +// return new Error(`JSON5: invalid lex state '${state}'`) +// } + +function invalidChar (c) { + if (c === undefined) { + return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) + } + + return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) +} + +function invalidEOF () { + return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) +} + +// This code is unreachable. +// function invalidToken () { +// if (token.type === 'eof') { +// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) +// } + +// const c = String.fromCodePoint(token.value.codePointAt(0)) +// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) +// } + +function invalidIdentifier () { + column -= 5 + return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`) +} + +function separatorChar (c) { + console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`) +} + +function formatChar (c) { + const replacements = { + "'": "\\'", + '"': '\\"', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t', + '\v': '\\v', + '\0': '\\0', + '\u2028': '\\u2028', + '\u2029': '\\u2029', + } + + if (replacements[c]) { + return replacements[c] + } + + if (c < ' ') { + const hexString = c.charCodeAt(0).toString(16) + return '\\x' + ('00' + hexString).substring(hexString.length) + } + + return c +} + +function syntaxError (message) { + const err = new SyntaxError(message) + err.lineNumber = line + err.columnNumber = column + return err +} diff --git a/tools/node_modules/@babel/core/node_modules/json5/lib/register.js b/tools/node_modules/@babel/core/node_modules/json5/lib/register.js new file mode 100644 index 00000000000000..935cdbafb323ac --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/lib/register.js @@ -0,0 +1,13 @@ +const fs = require('fs') +const JSON5 = require('./') + +// eslint-disable-next-line node/no-deprecated-api +require.extensions['.json5'] = function (module, filename) { + const content = fs.readFileSync(filename, 'utf8') + try { + module.exports = JSON5.parse(content) + } catch (err) { + err.message = filename + ': ' + err.message + throw err + } +} diff --git a/tools/node_modules/@babel/core/node_modules/json5/lib/require.js b/tools/node_modules/@babel/core/node_modules/json5/lib/require.js new file mode 100644 index 00000000000000..3aa29bee0344ef --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/lib/require.js @@ -0,0 +1,4 @@ +// This file is for backward compatibility with v0.5.1. +require('./register') + +console.warn("'json5/require' is deprecated. Please use 'json5/register' instead.") diff --git a/tools/node_modules/@babel/core/node_modules/json5/lib/stringify.js b/tools/node_modules/@babel/core/node_modules/json5/lib/stringify.js new file mode 100644 index 00000000000000..7cb3b0e101840b --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/lib/stringify.js @@ -0,0 +1,261 @@ +const util = require('./util') + +module.exports = function stringify (value, replacer, space) { + const stack = [] + let indent = '' + let propertyList + let replacerFunc + let gap = '' + let quote + + if ( + replacer != null && + typeof replacer === 'object' && + !Array.isArray(replacer) + ) { + space = replacer.space + quote = replacer.quote + replacer = replacer.replacer + } + + if (typeof replacer === 'function') { + replacerFunc = replacer + } else if (Array.isArray(replacer)) { + propertyList = [] + for (const v of replacer) { + let item + + if (typeof v === 'string') { + item = v + } else if ( + typeof v === 'number' || + v instanceof String || + v instanceof Number + ) { + item = String(v) + } + + if (item !== undefined && propertyList.indexOf(item) < 0) { + propertyList.push(item) + } + } + } + + if (space instanceof Number) { + space = Number(space) + } else if (space instanceof String) { + space = String(space) + } + + if (typeof space === 'number') { + if (space > 0) { + space = Math.min(10, Math.floor(space)) + gap = ' '.substr(0, space) + } + } else if (typeof space === 'string') { + gap = space.substr(0, 10) + } + + return serializeProperty('', {'': value}) + + function serializeProperty (key, holder) { + let value = holder[key] + if (value != null) { + if (typeof value.toJSON5 === 'function') { + value = value.toJSON5(key) + } else if (typeof value.toJSON === 'function') { + value = value.toJSON(key) + } + } + + if (replacerFunc) { + value = replacerFunc.call(holder, key, value) + } + + if (value instanceof Number) { + value = Number(value) + } else if (value instanceof String) { + value = String(value) + } else if (value instanceof Boolean) { + value = value.valueOf() + } + + switch (value) { + case null: return 'null' + case true: return 'true' + case false: return 'false' + } + + if (typeof value === 'string') { + return quoteString(value, false) + } + + if (typeof value === 'number') { + return String(value) + } + + if (typeof value === 'object') { + return Array.isArray(value) ? serializeArray(value) : serializeObject(value) + } + + return undefined + } + + function quoteString (value) { + const quotes = { + "'": 0.1, + '"': 0.2, + } + + const replacements = { + "'": "\\'", + '"': '\\"', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t', + '\v': '\\v', + '\0': '\\0', + '\u2028': '\\u2028', + '\u2029': '\\u2029', + } + + let product = '' + + for (let i = 0; i < value.length; i++) { + const c = value[i] + switch (c) { + case "'": + case '"': + quotes[c]++ + product += c + continue + + case '\0': + if (util.isDigit(value[i + 1])) { + product += '\\x00' + continue + } + } + + if (replacements[c]) { + product += replacements[c] + continue + } + + if (c < ' ') { + let hexString = c.charCodeAt(0).toString(16) + product += '\\x' + ('00' + hexString).substring(hexString.length) + continue + } + + product += c + } + + const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b) + + product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]) + + return quoteChar + product + quoteChar + } + + function serializeObject (value) { + if (stack.indexOf(value) >= 0) { + throw TypeError('Converting circular structure to JSON5') + } + + stack.push(value) + + let stepback = indent + indent = indent + gap + + let keys = propertyList || Object.keys(value) + let partial = [] + for (const key of keys) { + const propertyString = serializeProperty(key, value) + if (propertyString !== undefined) { + let member = serializeKey(key) + ':' + if (gap !== '') { + member += ' ' + } + member += propertyString + partial.push(member) + } + } + + let final + if (partial.length === 0) { + final = '{}' + } else { + let properties + if (gap === '') { + properties = partial.join(',') + final = '{' + properties + '}' + } else { + let separator = ',\n' + indent + properties = partial.join(separator) + final = '{\n' + indent + properties + ',\n' + stepback + '}' + } + } + + stack.pop() + indent = stepback + return final + } + + function serializeKey (key) { + if (key.length === 0) { + return quoteString(key, true) + } + + const firstChar = String.fromCodePoint(key.codePointAt(0)) + if (!util.isIdStartChar(firstChar)) { + return quoteString(key, true) + } + + for (let i = firstChar.length; i < key.length; i++) { + if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { + return quoteString(key, true) + } + } + + return key + } + + function serializeArray (value) { + if (stack.indexOf(value) >= 0) { + throw TypeError('Converting circular structure to JSON5') + } + + stack.push(value) + + let stepback = indent + indent = indent + gap + + let partial = [] + for (let i = 0; i < value.length; i++) { + const propertyString = serializeProperty(String(i), value) + partial.push((propertyString !== undefined) ? propertyString : 'null') + } + + let final + if (partial.length === 0) { + final = '[]' + } else { + if (gap === '') { + let properties = partial.join(',') + final = '[' + properties + ']' + } else { + let separator = ',\n' + indent + let properties = partial.join(separator) + final = '[\n' + indent + properties + ',\n' + stepback + ']' + } + } + + stack.pop() + indent = stepback + return final + } +} diff --git a/tools/node_modules/@babel/core/node_modules/json5/lib/unicode.js b/tools/node_modules/@babel/core/node_modules/json5/lib/unicode.js new file mode 100644 index 00000000000000..215ccd843abc25 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/lib/unicode.js @@ -0,0 +1,4 @@ +// This is a generated file. Do not edit. +module.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/ +module.exports.ID_Start = /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u1877\u1880-\u1884\u1887-\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/ +module.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ diff --git a/tools/node_modules/@babel/core/node_modules/json5/lib/util.js b/tools/node_modules/@babel/core/node_modules/json5/lib/util.js new file mode 100644 index 00000000000000..40bfe2fa6a67b2 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/lib/util.js @@ -0,0 +1,35 @@ +const unicode = require('../lib/unicode') + +module.exports = { + isSpaceSeparator (c) { + return typeof c === 'string' && unicode.Space_Separator.test(c) + }, + + isIdStartChar (c) { + return typeof c === 'string' && ( + (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c === '$') || (c === '_') || + unicode.ID_Start.test(c) + ) + }, + + isIdContinueChar (c) { + return typeof c === 'string' && ( + (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c >= '0' && c <= '9') || + (c === '$') || (c === '_') || + (c === '\u200C') || (c === '\u200D') || + unicode.ID_Continue.test(c) + ) + }, + + isDigit (c) { + return typeof c === 'string' && /[0-9]/.test(c) + }, + + isHexDigit (c) { + return typeof c === 'string' && /[0-9A-Fa-f]/.test(c) + }, +} diff --git a/tools/node_modules/@babel/core/node_modules/json5/package.json b/tools/node_modules/@babel/core/node_modules/json5/package.json new file mode 100644 index 00000000000000..9c5b82eae818e0 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/json5/package.json @@ -0,0 +1,71 @@ +{ + "name": "json5", + "version": "2.1.3", + "description": "JSON for humans.", + "main": "lib/index.js", + "module": "dist/index.mjs", + "bin": "lib/cli.js", + "browser": "dist/index.js", + "files": [ + "lib/", + "dist/" + ], + "engines": { + "node": ">=6" + }, + "scripts": { + "build": "rollup -c", + "build-package": "node build/package.js", + "build-unicode": "node build/unicode.js", + "coverage": "tap --coverage-report html test", + "lint": "eslint --fix .", + "prepublishOnly": "npm run production", + "preversion": "npm run production", + "production": "npm run lint && npm test && npm run build", + "test": "tap -Rspec --100 test", + "version": "npm run build-package && git add package.json5" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/json5/json5.git" + }, + "keywords": [ + "json", + "json5", + "es5", + "es2015", + "ecmascript" + ], + "author": "Aseem Kishore ", + "contributors": [ + "Max Nanasy ", + "Andrew Eisenberg ", + "Jordan Tucker " + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/json5/json5/issues" + }, + "homepage": "http://json5.org/", + "dependencies": { + "minimist": "^1.2.5" + }, + "devDependencies": { + "core-js": "^2.6.5", + "eslint": "^5.15.3", + "eslint-config-standard": "^12.0.0", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-node": "^8.0.1", + "eslint-plugin-promise": "^4.0.1", + "eslint-plugin-standard": "^4.0.0", + "regenerate": "^1.4.0", + "rollup": "^0.64.1", + "rollup-plugin-buble": "^0.19.6", + "rollup-plugin-commonjs": "^9.2.1", + "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-terser": "^1.0.1", + "sinon": "^6.3.5", + "tap": "^12.6.0", + "unicode-10.0.0": "^0.7.5" + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/LICENSE b/tools/node_modules/@babel/core/node_modules/lodash/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/LICENSE rename to tools/node_modules/@babel/core/node_modules/lodash/LICENSE diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/README.md b/tools/node_modules/@babel/core/node_modules/lodash/README.md similarity index 95% rename from tools/node_modules/babel-eslint/node_modules/lodash/README.md rename to tools/node_modules/@babel/core/node_modules/lodash/README.md index 292832fef2ff16..e1c99503300407 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/README.md +++ b/tools/node_modules/@babel/core/node_modules/lodash/README.md @@ -1,4 +1,4 @@ -# lodash v4.17.15 +# lodash v4.17.20 The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. @@ -28,7 +28,7 @@ var at = require('lodash/at'); var curryN = require('lodash/fp/curryN'); ``` -See the [package source](https://github.com/lodash/lodash/tree/4.17.15-npm) for more details. +See the [package source](https://github.com/lodash/lodash/tree/4.17.20-npm) for more details. **Note:**
Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL. diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_DataView.js b/tools/node_modules/@babel/core/node_modules/lodash/_DataView.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_DataView.js rename to tools/node_modules/@babel/core/node_modules/lodash/_DataView.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_Hash.js b/tools/node_modules/@babel/core/node_modules/lodash/_Hash.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_Hash.js rename to tools/node_modules/@babel/core/node_modules/lodash/_Hash.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_LazyWrapper.js b/tools/node_modules/@babel/core/node_modules/lodash/_LazyWrapper.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_LazyWrapper.js rename to tools/node_modules/@babel/core/node_modules/lodash/_LazyWrapper.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_ListCache.js b/tools/node_modules/@babel/core/node_modules/lodash/_ListCache.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_ListCache.js rename to tools/node_modules/@babel/core/node_modules/lodash/_ListCache.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_LodashWrapper.js b/tools/node_modules/@babel/core/node_modules/lodash/_LodashWrapper.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_LodashWrapper.js rename to tools/node_modules/@babel/core/node_modules/lodash/_LodashWrapper.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_Map.js b/tools/node_modules/@babel/core/node_modules/lodash/_Map.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_Map.js rename to tools/node_modules/@babel/core/node_modules/lodash/_Map.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_MapCache.js b/tools/node_modules/@babel/core/node_modules/lodash/_MapCache.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_MapCache.js rename to tools/node_modules/@babel/core/node_modules/lodash/_MapCache.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_Promise.js b/tools/node_modules/@babel/core/node_modules/lodash/_Promise.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_Promise.js rename to tools/node_modules/@babel/core/node_modules/lodash/_Promise.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_Set.js b/tools/node_modules/@babel/core/node_modules/lodash/_Set.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_Set.js rename to tools/node_modules/@babel/core/node_modules/lodash/_Set.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_SetCache.js b/tools/node_modules/@babel/core/node_modules/lodash/_SetCache.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_SetCache.js rename to tools/node_modules/@babel/core/node_modules/lodash/_SetCache.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_Stack.js b/tools/node_modules/@babel/core/node_modules/lodash/_Stack.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_Stack.js rename to tools/node_modules/@babel/core/node_modules/lodash/_Stack.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_Symbol.js b/tools/node_modules/@babel/core/node_modules/lodash/_Symbol.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_Symbol.js rename to tools/node_modules/@babel/core/node_modules/lodash/_Symbol.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_Uint8Array.js b/tools/node_modules/@babel/core/node_modules/lodash/_Uint8Array.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_Uint8Array.js rename to tools/node_modules/@babel/core/node_modules/lodash/_Uint8Array.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_WeakMap.js b/tools/node_modules/@babel/core/node_modules/lodash/_WeakMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_WeakMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/_WeakMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_apply.js b/tools/node_modules/@babel/core/node_modules/lodash/_apply.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_apply.js rename to tools/node_modules/@babel/core/node_modules/lodash/_apply.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayAggregator.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayAggregator.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayAggregator.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayAggregator.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayEach.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayEach.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayEach.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayEach.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayEachRight.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayEachRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayEachRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayEachRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayEvery.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayEvery.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayEvery.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayEvery.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayFilter.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayFilter.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayFilter.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayFilter.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayIncludes.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayIncludes.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayIncludes.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayIncludes.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayIncludesWith.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayIncludesWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayIncludesWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayIncludesWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayLikeKeys.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayLikeKeys.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayLikeKeys.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayLikeKeys.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayMap.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayPush.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayPush.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayPush.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayPush.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayReduce.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayReduce.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayReduce.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayReduce.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayReduceRight.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayReduceRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayReduceRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayReduceRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arraySample.js b/tools/node_modules/@babel/core/node_modules/lodash/_arraySample.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arraySample.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arraySample.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arraySampleSize.js b/tools/node_modules/@babel/core/node_modules/lodash/_arraySampleSize.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arraySampleSize.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arraySampleSize.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arrayShuffle.js b/tools/node_modules/@babel/core/node_modules/lodash/_arrayShuffle.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arrayShuffle.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arrayShuffle.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_arraySome.js b/tools/node_modules/@babel/core/node_modules/lodash/_arraySome.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_arraySome.js rename to tools/node_modules/@babel/core/node_modules/lodash/_arraySome.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_asciiSize.js b/tools/node_modules/@babel/core/node_modules/lodash/_asciiSize.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_asciiSize.js rename to tools/node_modules/@babel/core/node_modules/lodash/_asciiSize.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_asciiToArray.js b/tools/node_modules/@babel/core/node_modules/lodash/_asciiToArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_asciiToArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/_asciiToArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_asciiWords.js b/tools/node_modules/@babel/core/node_modules/lodash/_asciiWords.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_asciiWords.js rename to tools/node_modules/@babel/core/node_modules/lodash/_asciiWords.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_assignMergeValue.js b/tools/node_modules/@babel/core/node_modules/lodash/_assignMergeValue.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_assignMergeValue.js rename to tools/node_modules/@babel/core/node_modules/lodash/_assignMergeValue.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_assignValue.js b/tools/node_modules/@babel/core/node_modules/lodash/_assignValue.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_assignValue.js rename to tools/node_modules/@babel/core/node_modules/lodash/_assignValue.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_assocIndexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/_assocIndexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_assocIndexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/_assocIndexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseAggregator.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseAggregator.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseAggregator.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseAggregator.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseAssign.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseAssign.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseAssign.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseAssign.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseAssignIn.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseAssignIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseAssignIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseAssignIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseAssignValue.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseAssignValue.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseAssignValue.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseAssignValue.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseAt.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseAt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseAt.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseAt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseClamp.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseClamp.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseClamp.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseClamp.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseClone.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseClone.js similarity index 98% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseClone.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseClone.js index 290de9275def00..69f87054c56611 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/_baseClone.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/_baseClone.js @@ -18,7 +18,8 @@ var Stack = require('./_Stack'), isMap = require('./isMap'), isObject = require('./isObject'), isSet = require('./isSet'), - keys = require('./keys'); + keys = require('./keys'), + keysIn = require('./keysIn'); /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseConforms.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseConforms.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseConforms.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseConforms.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseConformsTo.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseConformsTo.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseConformsTo.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseConformsTo.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseCreate.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseCreate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseCreate.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseCreate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseDelay.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseDelay.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseDelay.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseDelay.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseDifference.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseDifference.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseDifference.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseDifference.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseEach.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseEach.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseEach.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseEach.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseEachRight.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseEachRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseEachRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseEachRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseEvery.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseEvery.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseEvery.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseEvery.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseExtremum.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseExtremum.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseExtremum.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseExtremum.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseFill.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseFill.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseFill.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseFill.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseFilter.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseFilter.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseFilter.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseFilter.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseFindIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseFindIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseFindIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseFindIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseFindKey.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseFindKey.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseFindKey.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseFindKey.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseFlatten.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseFlatten.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseFlatten.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseFlatten.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseFor.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseFor.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseFor.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseFor.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseForOwn.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseForOwn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseForOwn.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseForOwn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseForOwnRight.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseForOwnRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseForOwnRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseForOwnRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseForRight.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseForRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseForRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseForRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseFunctions.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseFunctions.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseFunctions.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseFunctions.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseGet.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseGet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseGet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseGet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseGetAllKeys.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseGetAllKeys.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseGetAllKeys.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseGetAllKeys.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseGetTag.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseGetTag.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseGetTag.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseGetTag.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseGt.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseGt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseGt.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseGt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseHas.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseHas.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseHas.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseHas.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseHasIn.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseHasIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseHasIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseHasIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseInRange.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseInRange.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseInRange.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseInRange.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIndexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIndexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIndexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIndexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIndexOfWith.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIndexOfWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIndexOfWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIndexOfWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIntersection.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIntersection.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIntersection.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIntersection.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseInverter.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseInverter.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseInverter.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseInverter.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseInvoke.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseInvoke.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseInvoke.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseInvoke.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsArguments.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsArguments.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsArguments.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsArguments.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsArrayBuffer.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsArrayBuffer.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsArrayBuffer.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsArrayBuffer.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsDate.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsDate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsDate.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsDate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsEqual.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsEqual.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsEqual.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsEqual.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsEqualDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsEqualDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsEqualDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsEqualDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsMap.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsMatch.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsMatch.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsMatch.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsMatch.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsNaN.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsNaN.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsNaN.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsNaN.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsNative.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsNative.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsNative.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsNative.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsRegExp.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsRegExp.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsRegExp.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsRegExp.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsSet.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsSet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsSet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsSet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIsTypedArray.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIsTypedArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIsTypedArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIsTypedArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseIteratee.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseIteratee.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseIteratee.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseIteratee.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseKeys.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseKeys.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseKeys.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseKeys.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseKeysIn.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseKeysIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseKeysIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseKeysIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseLodash.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseLodash.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseLodash.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseLodash.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseLt.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseLt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseLt.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseLt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseMap.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseMatches.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseMatches.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseMatches.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseMatches.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseMatchesProperty.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseMatchesProperty.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseMatchesProperty.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseMatchesProperty.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseMean.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseMean.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseMean.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseMean.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseMerge.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseMerge.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseMerge.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseMerge.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseMergeDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseMergeDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseMergeDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseMergeDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseNth.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseNth.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseNth.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseNth.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseOrderBy.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseOrderBy.js similarity index 68% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseOrderBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseOrderBy.js index d8a46ab20a2c5d..775a01741ede20 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/_baseOrderBy.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/_baseOrderBy.js @@ -1,10 +1,12 @@ var arrayMap = require('./_arrayMap'), + baseGet = require('./_baseGet'), baseIteratee = require('./_baseIteratee'), baseMap = require('./_baseMap'), baseSortBy = require('./_baseSortBy'), baseUnary = require('./_baseUnary'), compareMultiple = require('./_compareMultiple'), - identity = require('./identity'); + identity = require('./identity'), + isArray = require('./isArray'); /** * The base implementation of `_.orderBy` without param guards. @@ -16,8 +18,21 @@ var arrayMap = require('./_arrayMap'), * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + var index = -1; - iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); + iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_basePick.js b/tools/node_modules/@babel/core/node_modules/lodash/_basePick.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_basePick.js rename to tools/node_modules/@babel/core/node_modules/lodash/_basePick.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_basePickBy.js b/tools/node_modules/@babel/core/node_modules/lodash/_basePickBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_basePickBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/_basePickBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseProperty.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseProperty.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseProperty.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseProperty.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_basePropertyDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/_basePropertyDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_basePropertyDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/_basePropertyDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_basePropertyOf.js b/tools/node_modules/@babel/core/node_modules/lodash/_basePropertyOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_basePropertyOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/_basePropertyOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_basePullAll.js b/tools/node_modules/@babel/core/node_modules/lodash/_basePullAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_basePullAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/_basePullAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_basePullAt.js b/tools/node_modules/@babel/core/node_modules/lodash/_basePullAt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_basePullAt.js rename to tools/node_modules/@babel/core/node_modules/lodash/_basePullAt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseRandom.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseRandom.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseRandom.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseRandom.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseRange.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseRange.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseRange.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseRange.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseReduce.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseReduce.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseReduce.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseReduce.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseRepeat.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseRepeat.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseRepeat.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseRepeat.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseRest.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseRest.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseRest.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseRest.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSample.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSample.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSample.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSample.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSampleSize.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSampleSize.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSampleSize.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSampleSize.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSet.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSet.js similarity index 92% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSet.js index 612a24cc85791f..99f4fbf9c347a7 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSet.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/_baseSet.js @@ -29,6 +29,10 @@ function baseSet(object, path, value, customizer) { var key = toKey(path[index]), newValue = value; + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSetData.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSetData.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSetData.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSetData.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSetToString.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSetToString.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSetToString.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSetToString.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseShuffle.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseShuffle.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseShuffle.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseShuffle.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSlice.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSlice.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSlice.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSlice.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSome.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSome.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSome.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSome.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSortBy.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSortBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSortBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSortBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSortedIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSortedIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSortedIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSortedIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSortedIndexBy.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSortedIndexBy.js similarity index 94% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSortedIndexBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSortedIndexBy.js index bb22e36dcdf620..c247b377ff5b1a 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSortedIndexBy.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/_baseSortedIndexBy.js @@ -22,11 +22,14 @@ var nativeFloor = Math.floor, * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); - var low = 0, - high = array == null ? 0 : array.length, - valIsNaN = value !== value, + high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } + + value = iteratee(value); + var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined; diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSortedUniq.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSortedUniq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSortedUniq.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSortedUniq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseSum.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseSum.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseSum.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseSum.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseTimes.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseTimes.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseTimes.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseTimes.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseToNumber.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseToNumber.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseToNumber.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseToNumber.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseToPairs.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseToPairs.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseToPairs.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseToPairs.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseToString.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseToString.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseToString.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseToString.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseUnary.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseUnary.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseUnary.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseUnary.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseUniq.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseUniq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseUniq.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseUniq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseUnset.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseUnset.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseUnset.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseUnset.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseUpdate.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseUpdate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseUpdate.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseUpdate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseValues.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseValues.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseValues.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseValues.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseWhile.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseWhile.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseWhile.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseWhile.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseWrapperValue.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseWrapperValue.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseWrapperValue.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseWrapperValue.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseXor.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseXor.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseXor.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseXor.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_baseZipObject.js b/tools/node_modules/@babel/core/node_modules/lodash/_baseZipObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_baseZipObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/_baseZipObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_cacheHas.js b/tools/node_modules/@babel/core/node_modules/lodash/_cacheHas.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_cacheHas.js rename to tools/node_modules/@babel/core/node_modules/lodash/_cacheHas.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_castArrayLikeObject.js b/tools/node_modules/@babel/core/node_modules/lodash/_castArrayLikeObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_castArrayLikeObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/_castArrayLikeObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_castFunction.js b/tools/node_modules/@babel/core/node_modules/lodash/_castFunction.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_castFunction.js rename to tools/node_modules/@babel/core/node_modules/lodash/_castFunction.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_castPath.js b/tools/node_modules/@babel/core/node_modules/lodash/_castPath.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_castPath.js rename to tools/node_modules/@babel/core/node_modules/lodash/_castPath.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_castRest.js b/tools/node_modules/@babel/core/node_modules/lodash/_castRest.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_castRest.js rename to tools/node_modules/@babel/core/node_modules/lodash/_castRest.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_castSlice.js b/tools/node_modules/@babel/core/node_modules/lodash/_castSlice.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_castSlice.js rename to tools/node_modules/@babel/core/node_modules/lodash/_castSlice.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_charsEndIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/_charsEndIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_charsEndIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/_charsEndIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_charsStartIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/_charsStartIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_charsStartIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/_charsStartIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_cloneArrayBuffer.js b/tools/node_modules/@babel/core/node_modules/lodash/_cloneArrayBuffer.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_cloneArrayBuffer.js rename to tools/node_modules/@babel/core/node_modules/lodash/_cloneArrayBuffer.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_cloneBuffer.js b/tools/node_modules/@babel/core/node_modules/lodash/_cloneBuffer.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_cloneBuffer.js rename to tools/node_modules/@babel/core/node_modules/lodash/_cloneBuffer.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_cloneDataView.js b/tools/node_modules/@babel/core/node_modules/lodash/_cloneDataView.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_cloneDataView.js rename to tools/node_modules/@babel/core/node_modules/lodash/_cloneDataView.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_cloneRegExp.js b/tools/node_modules/@babel/core/node_modules/lodash/_cloneRegExp.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_cloneRegExp.js rename to tools/node_modules/@babel/core/node_modules/lodash/_cloneRegExp.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_cloneSymbol.js b/tools/node_modules/@babel/core/node_modules/lodash/_cloneSymbol.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_cloneSymbol.js rename to tools/node_modules/@babel/core/node_modules/lodash/_cloneSymbol.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_cloneTypedArray.js b/tools/node_modules/@babel/core/node_modules/lodash/_cloneTypedArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_cloneTypedArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/_cloneTypedArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_compareAscending.js b/tools/node_modules/@babel/core/node_modules/lodash/_compareAscending.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_compareAscending.js rename to tools/node_modules/@babel/core/node_modules/lodash/_compareAscending.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_compareMultiple.js b/tools/node_modules/@babel/core/node_modules/lodash/_compareMultiple.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_compareMultiple.js rename to tools/node_modules/@babel/core/node_modules/lodash/_compareMultiple.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_composeArgs.js b/tools/node_modules/@babel/core/node_modules/lodash/_composeArgs.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_composeArgs.js rename to tools/node_modules/@babel/core/node_modules/lodash/_composeArgs.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_composeArgsRight.js b/tools/node_modules/@babel/core/node_modules/lodash/_composeArgsRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_composeArgsRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/_composeArgsRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_copyArray.js b/tools/node_modules/@babel/core/node_modules/lodash/_copyArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_copyArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/_copyArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_copyObject.js b/tools/node_modules/@babel/core/node_modules/lodash/_copyObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_copyObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/_copyObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_copySymbols.js b/tools/node_modules/@babel/core/node_modules/lodash/_copySymbols.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_copySymbols.js rename to tools/node_modules/@babel/core/node_modules/lodash/_copySymbols.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_copySymbolsIn.js b/tools/node_modules/@babel/core/node_modules/lodash/_copySymbolsIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_copySymbolsIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/_copySymbolsIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_coreJsData.js b/tools/node_modules/@babel/core/node_modules/lodash/_coreJsData.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_coreJsData.js rename to tools/node_modules/@babel/core/node_modules/lodash/_coreJsData.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_countHolders.js b/tools/node_modules/@babel/core/node_modules/lodash/_countHolders.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_countHolders.js rename to tools/node_modules/@babel/core/node_modules/lodash/_countHolders.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createAggregator.js b/tools/node_modules/@babel/core/node_modules/lodash/_createAggregator.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createAggregator.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createAggregator.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createAssigner.js b/tools/node_modules/@babel/core/node_modules/lodash/_createAssigner.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createAssigner.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createAssigner.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createBaseEach.js b/tools/node_modules/@babel/core/node_modules/lodash/_createBaseEach.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createBaseEach.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createBaseEach.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createBaseFor.js b/tools/node_modules/@babel/core/node_modules/lodash/_createBaseFor.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createBaseFor.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createBaseFor.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createBind.js b/tools/node_modules/@babel/core/node_modules/lodash/_createBind.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createBind.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createBind.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createCaseFirst.js b/tools/node_modules/@babel/core/node_modules/lodash/_createCaseFirst.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createCaseFirst.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createCaseFirst.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createCompounder.js b/tools/node_modules/@babel/core/node_modules/lodash/_createCompounder.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createCompounder.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createCompounder.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createCtor.js b/tools/node_modules/@babel/core/node_modules/lodash/_createCtor.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createCtor.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createCtor.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createCurry.js b/tools/node_modules/@babel/core/node_modules/lodash/_createCurry.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createCurry.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createCurry.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createFind.js b/tools/node_modules/@babel/core/node_modules/lodash/_createFind.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createFind.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createFind.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createFlow.js b/tools/node_modules/@babel/core/node_modules/lodash/_createFlow.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createFlow.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createFlow.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createHybrid.js b/tools/node_modules/@babel/core/node_modules/lodash/_createHybrid.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createHybrid.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createHybrid.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createInverter.js b/tools/node_modules/@babel/core/node_modules/lodash/_createInverter.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createInverter.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createInverter.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createMathOperation.js b/tools/node_modules/@babel/core/node_modules/lodash/_createMathOperation.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createMathOperation.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createMathOperation.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createOver.js b/tools/node_modules/@babel/core/node_modules/lodash/_createOver.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createOver.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createOver.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createPadding.js b/tools/node_modules/@babel/core/node_modules/lodash/_createPadding.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createPadding.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createPadding.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createPartial.js b/tools/node_modules/@babel/core/node_modules/lodash/_createPartial.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createPartial.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createPartial.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createRange.js b/tools/node_modules/@babel/core/node_modules/lodash/_createRange.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createRange.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createRange.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createRecurry.js b/tools/node_modules/@babel/core/node_modules/lodash/_createRecurry.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createRecurry.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createRecurry.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createRelationalOperation.js b/tools/node_modules/@babel/core/node_modules/lodash/_createRelationalOperation.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createRelationalOperation.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createRelationalOperation.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createRound.js b/tools/node_modules/@babel/core/node_modules/lodash/_createRound.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createRound.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createRound.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createSet.js b/tools/node_modules/@babel/core/node_modules/lodash/_createSet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createSet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createSet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createToPairs.js b/tools/node_modules/@babel/core/node_modules/lodash/_createToPairs.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createToPairs.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createToPairs.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_createWrap.js b/tools/node_modules/@babel/core/node_modules/lodash/_createWrap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_createWrap.js rename to tools/node_modules/@babel/core/node_modules/lodash/_createWrap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_customDefaultsAssignIn.js b/tools/node_modules/@babel/core/node_modules/lodash/_customDefaultsAssignIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_customDefaultsAssignIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/_customDefaultsAssignIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_customDefaultsMerge.js b/tools/node_modules/@babel/core/node_modules/lodash/_customDefaultsMerge.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_customDefaultsMerge.js rename to tools/node_modules/@babel/core/node_modules/lodash/_customDefaultsMerge.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_customOmitClone.js b/tools/node_modules/@babel/core/node_modules/lodash/_customOmitClone.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_customOmitClone.js rename to tools/node_modules/@babel/core/node_modules/lodash/_customOmitClone.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_deburrLetter.js b/tools/node_modules/@babel/core/node_modules/lodash/_deburrLetter.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_deburrLetter.js rename to tools/node_modules/@babel/core/node_modules/lodash/_deburrLetter.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_defineProperty.js b/tools/node_modules/@babel/core/node_modules/lodash/_defineProperty.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_defineProperty.js rename to tools/node_modules/@babel/core/node_modules/lodash/_defineProperty.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_equalArrays.js b/tools/node_modules/@babel/core/node_modules/lodash/_equalArrays.js similarity index 92% rename from tools/node_modules/babel-eslint/node_modules/lodash/_equalArrays.js rename to tools/node_modules/@babel/core/node_modules/lodash/_equalArrays.js index f6a3b7c9f27640..824228c78cb8ab 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/_equalArrays.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/_equalArrays.js @@ -27,10 +27,11 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked && stack.get(other)) { - return stacked == other; + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; } var index = -1, result = true, diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_equalByTag.js b/tools/node_modules/@babel/core/node_modules/lodash/_equalByTag.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_equalByTag.js rename to tools/node_modules/@babel/core/node_modules/lodash/_equalByTag.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_equalObjects.js b/tools/node_modules/@babel/core/node_modules/lodash/_equalObjects.js similarity index 93% rename from tools/node_modules/babel-eslint/node_modules/lodash/_equalObjects.js rename to tools/node_modules/@babel/core/node_modules/lodash/_equalObjects.js index 17421f374c9986..cdaacd2dfd8895 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/_equalObjects.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/_equalObjects.js @@ -39,10 +39,11 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { return false; } } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked && stack.get(other)) { - return stacked == other; + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; } var result = true; stack.set(object, other); diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_escapeHtmlChar.js b/tools/node_modules/@babel/core/node_modules/lodash/_escapeHtmlChar.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_escapeHtmlChar.js rename to tools/node_modules/@babel/core/node_modules/lodash/_escapeHtmlChar.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_escapeStringChar.js b/tools/node_modules/@babel/core/node_modules/lodash/_escapeStringChar.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_escapeStringChar.js rename to tools/node_modules/@babel/core/node_modules/lodash/_escapeStringChar.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_flatRest.js b/tools/node_modules/@babel/core/node_modules/lodash/_flatRest.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_flatRest.js rename to tools/node_modules/@babel/core/node_modules/lodash/_flatRest.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_freeGlobal.js b/tools/node_modules/@babel/core/node_modules/lodash/_freeGlobal.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_freeGlobal.js rename to tools/node_modules/@babel/core/node_modules/lodash/_freeGlobal.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getAllKeys.js b/tools/node_modules/@babel/core/node_modules/lodash/_getAllKeys.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getAllKeys.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getAllKeys.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getAllKeysIn.js b/tools/node_modules/@babel/core/node_modules/lodash/_getAllKeysIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getAllKeysIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getAllKeysIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getData.js b/tools/node_modules/@babel/core/node_modules/lodash/_getData.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getData.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getData.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getFuncName.js b/tools/node_modules/@babel/core/node_modules/lodash/_getFuncName.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getFuncName.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getFuncName.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getHolder.js b/tools/node_modules/@babel/core/node_modules/lodash/_getHolder.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getHolder.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getHolder.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getMapData.js b/tools/node_modules/@babel/core/node_modules/lodash/_getMapData.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getMapData.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getMapData.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getMatchData.js b/tools/node_modules/@babel/core/node_modules/lodash/_getMatchData.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getMatchData.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getMatchData.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getNative.js b/tools/node_modules/@babel/core/node_modules/lodash/_getNative.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getNative.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getNative.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getPrototype.js b/tools/node_modules/@babel/core/node_modules/lodash/_getPrototype.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getPrototype.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getPrototype.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getRawTag.js b/tools/node_modules/@babel/core/node_modules/lodash/_getRawTag.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getRawTag.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getRawTag.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getSymbols.js b/tools/node_modules/@babel/core/node_modules/lodash/_getSymbols.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getSymbols.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getSymbols.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getSymbolsIn.js b/tools/node_modules/@babel/core/node_modules/lodash/_getSymbolsIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getSymbolsIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getSymbolsIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getTag.js b/tools/node_modules/@babel/core/node_modules/lodash/_getTag.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getTag.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getTag.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getValue.js b/tools/node_modules/@babel/core/node_modules/lodash/_getValue.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getValue.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getValue.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getView.js b/tools/node_modules/@babel/core/node_modules/lodash/_getView.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getView.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getView.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_getWrapDetails.js b/tools/node_modules/@babel/core/node_modules/lodash/_getWrapDetails.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_getWrapDetails.js rename to tools/node_modules/@babel/core/node_modules/lodash/_getWrapDetails.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_hasPath.js b/tools/node_modules/@babel/core/node_modules/lodash/_hasPath.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_hasPath.js rename to tools/node_modules/@babel/core/node_modules/lodash/_hasPath.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_hasUnicode.js b/tools/node_modules/@babel/core/node_modules/lodash/_hasUnicode.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_hasUnicode.js rename to tools/node_modules/@babel/core/node_modules/lodash/_hasUnicode.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_hasUnicodeWord.js b/tools/node_modules/@babel/core/node_modules/lodash/_hasUnicodeWord.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_hasUnicodeWord.js rename to tools/node_modules/@babel/core/node_modules/lodash/_hasUnicodeWord.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_hashClear.js b/tools/node_modules/@babel/core/node_modules/lodash/_hashClear.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_hashClear.js rename to tools/node_modules/@babel/core/node_modules/lodash/_hashClear.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_hashDelete.js b/tools/node_modules/@babel/core/node_modules/lodash/_hashDelete.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_hashDelete.js rename to tools/node_modules/@babel/core/node_modules/lodash/_hashDelete.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_hashGet.js b/tools/node_modules/@babel/core/node_modules/lodash/_hashGet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_hashGet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_hashGet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_hashHas.js b/tools/node_modules/@babel/core/node_modules/lodash/_hashHas.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_hashHas.js rename to tools/node_modules/@babel/core/node_modules/lodash/_hashHas.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_hashSet.js b/tools/node_modules/@babel/core/node_modules/lodash/_hashSet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_hashSet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_hashSet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_initCloneArray.js b/tools/node_modules/@babel/core/node_modules/lodash/_initCloneArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_initCloneArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/_initCloneArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_initCloneByTag.js b/tools/node_modules/@babel/core/node_modules/lodash/_initCloneByTag.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_initCloneByTag.js rename to tools/node_modules/@babel/core/node_modules/lodash/_initCloneByTag.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_initCloneObject.js b/tools/node_modules/@babel/core/node_modules/lodash/_initCloneObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_initCloneObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/_initCloneObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_insertWrapDetails.js b/tools/node_modules/@babel/core/node_modules/lodash/_insertWrapDetails.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_insertWrapDetails.js rename to tools/node_modules/@babel/core/node_modules/lodash/_insertWrapDetails.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_isFlattenable.js b/tools/node_modules/@babel/core/node_modules/lodash/_isFlattenable.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_isFlattenable.js rename to tools/node_modules/@babel/core/node_modules/lodash/_isFlattenable.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_isIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/_isIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_isIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/_isIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_isIterateeCall.js b/tools/node_modules/@babel/core/node_modules/lodash/_isIterateeCall.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_isIterateeCall.js rename to tools/node_modules/@babel/core/node_modules/lodash/_isIterateeCall.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_isKey.js b/tools/node_modules/@babel/core/node_modules/lodash/_isKey.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_isKey.js rename to tools/node_modules/@babel/core/node_modules/lodash/_isKey.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_isKeyable.js b/tools/node_modules/@babel/core/node_modules/lodash/_isKeyable.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_isKeyable.js rename to tools/node_modules/@babel/core/node_modules/lodash/_isKeyable.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_isLaziable.js b/tools/node_modules/@babel/core/node_modules/lodash/_isLaziable.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_isLaziable.js rename to tools/node_modules/@babel/core/node_modules/lodash/_isLaziable.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_isMaskable.js b/tools/node_modules/@babel/core/node_modules/lodash/_isMaskable.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_isMaskable.js rename to tools/node_modules/@babel/core/node_modules/lodash/_isMaskable.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_isMasked.js b/tools/node_modules/@babel/core/node_modules/lodash/_isMasked.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_isMasked.js rename to tools/node_modules/@babel/core/node_modules/lodash/_isMasked.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_isPrototype.js b/tools/node_modules/@babel/core/node_modules/lodash/_isPrototype.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_isPrototype.js rename to tools/node_modules/@babel/core/node_modules/lodash/_isPrototype.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_isStrictComparable.js b/tools/node_modules/@babel/core/node_modules/lodash/_isStrictComparable.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_isStrictComparable.js rename to tools/node_modules/@babel/core/node_modules/lodash/_isStrictComparable.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_iteratorToArray.js b/tools/node_modules/@babel/core/node_modules/lodash/_iteratorToArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_iteratorToArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/_iteratorToArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_lazyClone.js b/tools/node_modules/@babel/core/node_modules/lodash/_lazyClone.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_lazyClone.js rename to tools/node_modules/@babel/core/node_modules/lodash/_lazyClone.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_lazyReverse.js b/tools/node_modules/@babel/core/node_modules/lodash/_lazyReverse.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_lazyReverse.js rename to tools/node_modules/@babel/core/node_modules/lodash/_lazyReverse.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_lazyValue.js b/tools/node_modules/@babel/core/node_modules/lodash/_lazyValue.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_lazyValue.js rename to tools/node_modules/@babel/core/node_modules/lodash/_lazyValue.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_listCacheClear.js b/tools/node_modules/@babel/core/node_modules/lodash/_listCacheClear.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_listCacheClear.js rename to tools/node_modules/@babel/core/node_modules/lodash/_listCacheClear.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_listCacheDelete.js b/tools/node_modules/@babel/core/node_modules/lodash/_listCacheDelete.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_listCacheDelete.js rename to tools/node_modules/@babel/core/node_modules/lodash/_listCacheDelete.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_listCacheGet.js b/tools/node_modules/@babel/core/node_modules/lodash/_listCacheGet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_listCacheGet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_listCacheGet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_listCacheHas.js b/tools/node_modules/@babel/core/node_modules/lodash/_listCacheHas.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_listCacheHas.js rename to tools/node_modules/@babel/core/node_modules/lodash/_listCacheHas.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_listCacheSet.js b/tools/node_modules/@babel/core/node_modules/lodash/_listCacheSet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_listCacheSet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_listCacheSet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_mapCacheClear.js b/tools/node_modules/@babel/core/node_modules/lodash/_mapCacheClear.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_mapCacheClear.js rename to tools/node_modules/@babel/core/node_modules/lodash/_mapCacheClear.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_mapCacheDelete.js b/tools/node_modules/@babel/core/node_modules/lodash/_mapCacheDelete.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_mapCacheDelete.js rename to tools/node_modules/@babel/core/node_modules/lodash/_mapCacheDelete.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_mapCacheGet.js b/tools/node_modules/@babel/core/node_modules/lodash/_mapCacheGet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_mapCacheGet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_mapCacheGet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_mapCacheHas.js b/tools/node_modules/@babel/core/node_modules/lodash/_mapCacheHas.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_mapCacheHas.js rename to tools/node_modules/@babel/core/node_modules/lodash/_mapCacheHas.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_mapCacheSet.js b/tools/node_modules/@babel/core/node_modules/lodash/_mapCacheSet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_mapCacheSet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_mapCacheSet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_mapToArray.js b/tools/node_modules/@babel/core/node_modules/lodash/_mapToArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_mapToArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/_mapToArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_matchesStrictComparable.js b/tools/node_modules/@babel/core/node_modules/lodash/_matchesStrictComparable.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_matchesStrictComparable.js rename to tools/node_modules/@babel/core/node_modules/lodash/_matchesStrictComparable.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_memoizeCapped.js b/tools/node_modules/@babel/core/node_modules/lodash/_memoizeCapped.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_memoizeCapped.js rename to tools/node_modules/@babel/core/node_modules/lodash/_memoizeCapped.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_mergeData.js b/tools/node_modules/@babel/core/node_modules/lodash/_mergeData.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_mergeData.js rename to tools/node_modules/@babel/core/node_modules/lodash/_mergeData.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_metaMap.js b/tools/node_modules/@babel/core/node_modules/lodash/_metaMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_metaMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/_metaMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_nativeCreate.js b/tools/node_modules/@babel/core/node_modules/lodash/_nativeCreate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_nativeCreate.js rename to tools/node_modules/@babel/core/node_modules/lodash/_nativeCreate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_nativeKeys.js b/tools/node_modules/@babel/core/node_modules/lodash/_nativeKeys.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_nativeKeys.js rename to tools/node_modules/@babel/core/node_modules/lodash/_nativeKeys.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_nativeKeysIn.js b/tools/node_modules/@babel/core/node_modules/lodash/_nativeKeysIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_nativeKeysIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/_nativeKeysIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_nodeUtil.js b/tools/node_modules/@babel/core/node_modules/lodash/_nodeUtil.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_nodeUtil.js rename to tools/node_modules/@babel/core/node_modules/lodash/_nodeUtil.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_objectToString.js b/tools/node_modules/@babel/core/node_modules/lodash/_objectToString.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_objectToString.js rename to tools/node_modules/@babel/core/node_modules/lodash/_objectToString.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_overArg.js b/tools/node_modules/@babel/core/node_modules/lodash/_overArg.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_overArg.js rename to tools/node_modules/@babel/core/node_modules/lodash/_overArg.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_overRest.js b/tools/node_modules/@babel/core/node_modules/lodash/_overRest.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_overRest.js rename to tools/node_modules/@babel/core/node_modules/lodash/_overRest.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_parent.js b/tools/node_modules/@babel/core/node_modules/lodash/_parent.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_parent.js rename to tools/node_modules/@babel/core/node_modules/lodash/_parent.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_reEscape.js b/tools/node_modules/@babel/core/node_modules/lodash/_reEscape.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_reEscape.js rename to tools/node_modules/@babel/core/node_modules/lodash/_reEscape.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_reEvaluate.js b/tools/node_modules/@babel/core/node_modules/lodash/_reEvaluate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_reEvaluate.js rename to tools/node_modules/@babel/core/node_modules/lodash/_reEvaluate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_reInterpolate.js b/tools/node_modules/@babel/core/node_modules/lodash/_reInterpolate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_reInterpolate.js rename to tools/node_modules/@babel/core/node_modules/lodash/_reInterpolate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_realNames.js b/tools/node_modules/@babel/core/node_modules/lodash/_realNames.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_realNames.js rename to tools/node_modules/@babel/core/node_modules/lodash/_realNames.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_reorder.js b/tools/node_modules/@babel/core/node_modules/lodash/_reorder.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_reorder.js rename to tools/node_modules/@babel/core/node_modules/lodash/_reorder.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_replaceHolders.js b/tools/node_modules/@babel/core/node_modules/lodash/_replaceHolders.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_replaceHolders.js rename to tools/node_modules/@babel/core/node_modules/lodash/_replaceHolders.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_root.js b/tools/node_modules/@babel/core/node_modules/lodash/_root.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_root.js rename to tools/node_modules/@babel/core/node_modules/lodash/_root.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_safeGet.js b/tools/node_modules/@babel/core/node_modules/lodash/_safeGet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_safeGet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_safeGet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_setCacheAdd.js b/tools/node_modules/@babel/core/node_modules/lodash/_setCacheAdd.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_setCacheAdd.js rename to tools/node_modules/@babel/core/node_modules/lodash/_setCacheAdd.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_setCacheHas.js b/tools/node_modules/@babel/core/node_modules/lodash/_setCacheHas.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_setCacheHas.js rename to tools/node_modules/@babel/core/node_modules/lodash/_setCacheHas.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_setData.js b/tools/node_modules/@babel/core/node_modules/lodash/_setData.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_setData.js rename to tools/node_modules/@babel/core/node_modules/lodash/_setData.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_setToArray.js b/tools/node_modules/@babel/core/node_modules/lodash/_setToArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_setToArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/_setToArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_setToPairs.js b/tools/node_modules/@babel/core/node_modules/lodash/_setToPairs.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_setToPairs.js rename to tools/node_modules/@babel/core/node_modules/lodash/_setToPairs.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_setToString.js b/tools/node_modules/@babel/core/node_modules/lodash/_setToString.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_setToString.js rename to tools/node_modules/@babel/core/node_modules/lodash/_setToString.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_setWrapToString.js b/tools/node_modules/@babel/core/node_modules/lodash/_setWrapToString.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_setWrapToString.js rename to tools/node_modules/@babel/core/node_modules/lodash/_setWrapToString.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_shortOut.js b/tools/node_modules/@babel/core/node_modules/lodash/_shortOut.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_shortOut.js rename to tools/node_modules/@babel/core/node_modules/lodash/_shortOut.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_shuffleSelf.js b/tools/node_modules/@babel/core/node_modules/lodash/_shuffleSelf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_shuffleSelf.js rename to tools/node_modules/@babel/core/node_modules/lodash/_shuffleSelf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_stackClear.js b/tools/node_modules/@babel/core/node_modules/lodash/_stackClear.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_stackClear.js rename to tools/node_modules/@babel/core/node_modules/lodash/_stackClear.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_stackDelete.js b/tools/node_modules/@babel/core/node_modules/lodash/_stackDelete.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_stackDelete.js rename to tools/node_modules/@babel/core/node_modules/lodash/_stackDelete.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_stackGet.js b/tools/node_modules/@babel/core/node_modules/lodash/_stackGet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_stackGet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_stackGet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_stackHas.js b/tools/node_modules/@babel/core/node_modules/lodash/_stackHas.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_stackHas.js rename to tools/node_modules/@babel/core/node_modules/lodash/_stackHas.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_stackSet.js b/tools/node_modules/@babel/core/node_modules/lodash/_stackSet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_stackSet.js rename to tools/node_modules/@babel/core/node_modules/lodash/_stackSet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_strictIndexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/_strictIndexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_strictIndexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/_strictIndexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_strictLastIndexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/_strictLastIndexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_strictLastIndexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/_strictLastIndexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_stringSize.js b/tools/node_modules/@babel/core/node_modules/lodash/_stringSize.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_stringSize.js rename to tools/node_modules/@babel/core/node_modules/lodash/_stringSize.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_stringToArray.js b/tools/node_modules/@babel/core/node_modules/lodash/_stringToArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_stringToArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/_stringToArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_stringToPath.js b/tools/node_modules/@babel/core/node_modules/lodash/_stringToPath.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_stringToPath.js rename to tools/node_modules/@babel/core/node_modules/lodash/_stringToPath.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_toKey.js b/tools/node_modules/@babel/core/node_modules/lodash/_toKey.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_toKey.js rename to tools/node_modules/@babel/core/node_modules/lodash/_toKey.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_toSource.js b/tools/node_modules/@babel/core/node_modules/lodash/_toSource.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_toSource.js rename to tools/node_modules/@babel/core/node_modules/lodash/_toSource.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_unescapeHtmlChar.js b/tools/node_modules/@babel/core/node_modules/lodash/_unescapeHtmlChar.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_unescapeHtmlChar.js rename to tools/node_modules/@babel/core/node_modules/lodash/_unescapeHtmlChar.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_unicodeSize.js b/tools/node_modules/@babel/core/node_modules/lodash/_unicodeSize.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_unicodeSize.js rename to tools/node_modules/@babel/core/node_modules/lodash/_unicodeSize.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_unicodeToArray.js b/tools/node_modules/@babel/core/node_modules/lodash/_unicodeToArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_unicodeToArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/_unicodeToArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_unicodeWords.js b/tools/node_modules/@babel/core/node_modules/lodash/_unicodeWords.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_unicodeWords.js rename to tools/node_modules/@babel/core/node_modules/lodash/_unicodeWords.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_updateWrapDetails.js b/tools/node_modules/@babel/core/node_modules/lodash/_updateWrapDetails.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_updateWrapDetails.js rename to tools/node_modules/@babel/core/node_modules/lodash/_updateWrapDetails.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/_wrapperClone.js b/tools/node_modules/@babel/core/node_modules/lodash/_wrapperClone.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/_wrapperClone.js rename to tools/node_modules/@babel/core/node_modules/lodash/_wrapperClone.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/add.js b/tools/node_modules/@babel/core/node_modules/lodash/add.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/add.js rename to tools/node_modules/@babel/core/node_modules/lodash/add.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/after.js b/tools/node_modules/@babel/core/node_modules/lodash/after.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/after.js rename to tools/node_modules/@babel/core/node_modules/lodash/after.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/array.js b/tools/node_modules/@babel/core/node_modules/lodash/array.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/array.js rename to tools/node_modules/@babel/core/node_modules/lodash/array.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/ary.js b/tools/node_modules/@babel/core/node_modules/lodash/ary.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/ary.js rename to tools/node_modules/@babel/core/node_modules/lodash/ary.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/assign.js b/tools/node_modules/@babel/core/node_modules/lodash/assign.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/assign.js rename to tools/node_modules/@babel/core/node_modules/lodash/assign.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/assignIn.js b/tools/node_modules/@babel/core/node_modules/lodash/assignIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/assignIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/assignIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/assignInWith.js b/tools/node_modules/@babel/core/node_modules/lodash/assignInWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/assignInWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/assignInWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/assignWith.js b/tools/node_modules/@babel/core/node_modules/lodash/assignWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/assignWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/assignWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/at.js b/tools/node_modules/@babel/core/node_modules/lodash/at.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/at.js rename to tools/node_modules/@babel/core/node_modules/lodash/at.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/attempt.js b/tools/node_modules/@babel/core/node_modules/lodash/attempt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/attempt.js rename to tools/node_modules/@babel/core/node_modules/lodash/attempt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/before.js b/tools/node_modules/@babel/core/node_modules/lodash/before.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/before.js rename to tools/node_modules/@babel/core/node_modules/lodash/before.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/bind.js b/tools/node_modules/@babel/core/node_modules/lodash/bind.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/bind.js rename to tools/node_modules/@babel/core/node_modules/lodash/bind.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/bindAll.js b/tools/node_modules/@babel/core/node_modules/lodash/bindAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/bindAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/bindAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/bindKey.js b/tools/node_modules/@babel/core/node_modules/lodash/bindKey.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/bindKey.js rename to tools/node_modules/@babel/core/node_modules/lodash/bindKey.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/camelCase.js b/tools/node_modules/@babel/core/node_modules/lodash/camelCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/camelCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/camelCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/capitalize.js b/tools/node_modules/@babel/core/node_modules/lodash/capitalize.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/capitalize.js rename to tools/node_modules/@babel/core/node_modules/lodash/capitalize.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/castArray.js b/tools/node_modules/@babel/core/node_modules/lodash/castArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/castArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/castArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/ceil.js b/tools/node_modules/@babel/core/node_modules/lodash/ceil.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/ceil.js rename to tools/node_modules/@babel/core/node_modules/lodash/ceil.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/chain.js b/tools/node_modules/@babel/core/node_modules/lodash/chain.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/chain.js rename to tools/node_modules/@babel/core/node_modules/lodash/chain.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/chunk.js b/tools/node_modules/@babel/core/node_modules/lodash/chunk.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/chunk.js rename to tools/node_modules/@babel/core/node_modules/lodash/chunk.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/clamp.js b/tools/node_modules/@babel/core/node_modules/lodash/clamp.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/clamp.js rename to tools/node_modules/@babel/core/node_modules/lodash/clamp.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/clone.js b/tools/node_modules/@babel/core/node_modules/lodash/clone.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/clone.js rename to tools/node_modules/@babel/core/node_modules/lodash/clone.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/cloneDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/cloneDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/cloneDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/cloneDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/cloneDeepWith.js b/tools/node_modules/@babel/core/node_modules/lodash/cloneDeepWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/cloneDeepWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/cloneDeepWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/cloneWith.js b/tools/node_modules/@babel/core/node_modules/lodash/cloneWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/cloneWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/cloneWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/collection.js b/tools/node_modules/@babel/core/node_modules/lodash/collection.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/collection.js rename to tools/node_modules/@babel/core/node_modules/lodash/collection.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/commit.js b/tools/node_modules/@babel/core/node_modules/lodash/commit.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/commit.js rename to tools/node_modules/@babel/core/node_modules/lodash/commit.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/compact.js b/tools/node_modules/@babel/core/node_modules/lodash/compact.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/compact.js rename to tools/node_modules/@babel/core/node_modules/lodash/compact.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/concat.js b/tools/node_modules/@babel/core/node_modules/lodash/concat.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/concat.js rename to tools/node_modules/@babel/core/node_modules/lodash/concat.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/cond.js b/tools/node_modules/@babel/core/node_modules/lodash/cond.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/cond.js rename to tools/node_modules/@babel/core/node_modules/lodash/cond.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/conforms.js b/tools/node_modules/@babel/core/node_modules/lodash/conforms.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/conforms.js rename to tools/node_modules/@babel/core/node_modules/lodash/conforms.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/conformsTo.js b/tools/node_modules/@babel/core/node_modules/lodash/conformsTo.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/conformsTo.js rename to tools/node_modules/@babel/core/node_modules/lodash/conformsTo.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/constant.js b/tools/node_modules/@babel/core/node_modules/lodash/constant.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/constant.js rename to tools/node_modules/@babel/core/node_modules/lodash/constant.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/core.js b/tools/node_modules/@babel/core/node_modules/lodash/core.js similarity index 99% rename from tools/node_modules/babel-eslint/node_modules/lodash/core.js rename to tools/node_modules/@babel/core/node_modules/lodash/core.js index 89c77ded06308d..6d70dcaf87035b 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/core.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/core.js @@ -13,7 +13,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.17.15'; + var VERSION = '4.17.20'; /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -1183,6 +1183,12 @@ if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? [] : undefined; @@ -1293,6 +1299,12 @@ return false; } } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } var result = true; var skipCtor = isPartial; @@ -1935,6 +1947,10 @@ * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] */ function filter(collection, predicate) { return baseFilter(collection, baseIteratee(predicate)); @@ -2188,15 +2204,15 @@ * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, + * { 'user': 'fred', 'age': 30 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] * * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] */ function sortBy(collection, iteratee) { var index = 0; @@ -3503,6 +3519,9 @@ * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * + * **Note:** Multiple values can be checked by combining several matchers + * using `_.overSome` + * * @static * @memberOf _ * @since 3.0.0 @@ -3518,6 +3537,10 @@ * * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); * // => [{ 'a': 4, 'b': 5, 'c': 6 }] + * + * // Checking for several possible values + * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); + * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] */ function matches(source) { return baseMatches(assign({}, source)); diff --git a/tools/node_modules/@babel/core/node_modules/lodash/core.min.js b/tools/node_modules/@babel/core/node_modules/lodash/core.min.js new file mode 100644 index 00000000000000..f40952565b2e65 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/lodash/core.min.js @@ -0,0 +1,30 @@ +/** + * @license + * Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * Build: `lodash core -o ./dist/lodash.core.js` + */ +;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r,e){for(var u=n.length,o=r+(e?1:-1);e?o--:++o0&&e(f)?r>1?y(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function g(n,t){return n&&Vt(n,t,cr)}function _(n,t){return v(t,function(t){return Tn(n[t])})}function b(n){return W(n)}function j(n,t){return n>t}function d(n){return In(n)&&b(n)==ht}function m(n,t,r,e,u){return n===t||(null==n||null==t||!In(n)&&!In(t)?n!==n&&t!==t:O(n,t,r,e,m,u))}function O(n,t,r,e,u,o){ +var i=Zt(n),c=Zt(t),f=i?lt:b(n),a=c?lt:b(t);f=f==at?bt:f,a=a==at?bt:a;var l=f==bt,p=a==bt,s=f==a;o||(o=[]);var h=Lt(o,function(t){return t[0]==n}),v=Lt(o,function(n){return n[0]==t});if(h&&v)return h[1]==t;if(o.push([n,t]),o.push([t,n]),s&&!l){var y=i?J(n,t,r,e,u,o):M(n,t,f,r,e,u,o);return o.pop(),y}if(!(r&et)){var g=l&&Rt.call(n,"__wrapped__"),_=p&&Rt.call(t,"__wrapped__");if(g||_){var j=g?n.value():n,d=_?t.value():t,y=u(j,d,r,e,o);return o.pop(),y}}if(!s)return false;var y=U(n,t,r,e,u,o);return o.pop(), +y}function x(n){return In(n)&&b(n)==dt}function w(n){return typeof n=="function"?n:null==n?Hn:(typeof n=="object"?N:r)(n)}function A(n,t){return nu?0:u+t),r=r>u?u:r,r<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(u);++et||o&&i&&f&&!c&&!a||e&&i&&f||!r&&f||!u)return 1; +if(!e&&!o&&!a&&n1?r[u-1]:nt;for(o=n.length>3&&typeof o=="function"?(u--,o):nt,t=Object(t);++e-1?u[o?t[i]:i]:nt}}function G(n,t,r,e){function u(){for(var t=-1,c=arguments.length,f=-1,a=e.length,l=Array(a+c),p=this&&this!==kt&&this instanceof u?i:n;++fc))return false;var a=o.get(n),l=o.get(t);if(a&&l)return a==t&&l==n;for(var p=-1,s=true,h=r&ut?[]:nt;++p-1&&n%1==0&&n0&&(r=t.apply(this,arguments)),n<=1&&(t=nt),r}}function mn(n){if(typeof n!="function")throw new TypeError(rt);return function(){return!n.apply(this,arguments)}; +}function On(n){return dn(2,n)}function xn(n){return Bn(n)?Zt(n)?S(n):$(n,Gt(n)):n}function wn(n,t){return n===t||n!==n&&t!==t}function An(n){return null!=n&&Sn(n.length)&&!Tn(n)}function En(n){return n===true||n===false||In(n)&&b(n)==st}function Nn(n){return An(n)&&(Zt(n)||Dn(n)||Tn(n.splice)||Yt(n))?!n.length:!Gt(n).length}function kn(n,t){return m(n,t)}function Fn(n){return typeof n=="number"&&Ct(n)}function Tn(n){if(!Bn(n))return false;var t=b(n);return t==yt||t==gt||t==pt||t==jt}function Sn(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ft; +}function Bn(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function In(n){return null!=n&&typeof n=="object"}function Rn(n){return qn(n)&&n!=+n}function $n(n){return null===n}function qn(n){return typeof n=="number"||In(n)&&b(n)==_t}function Dn(n){return typeof n=="string"||!Zt(n)&&In(n)&&b(n)==mt}function Pn(n){return n===nt}function zn(n){return An(n)?n.length?S(n):[]:Un(n)}function Cn(n){return typeof n=="string"?n:null==n?"":n+""}function Gn(n,t){var r=Mt(n);return null==t?r:ur(r,t); +}function Jn(n,t){return null!=n&&Rt.call(n,t)}function Mn(n,t,r){var e=null==n?nt:n[t];return e===nt&&(e=r),Tn(e)?e.call(n):e}function Un(n){return null==n?[]:o(n,cr(n))}function Vn(n){return n=Cn(n),n&&xt.test(n)?n.replace(Ot,St):n}function Hn(n){return n}function Kn(n){return N(ur({},n))}function Ln(t,r,e){var u=cr(r),o=_(r,u);null!=e||Bn(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=_(r,cr(r)));var i=!(Bn(e)&&"chain"in e&&!e.chain),c=Tn(t);return Ut(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){ +var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=S(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}function Qn(){return kt._===this&&(kt._=Dt),this}function Wn(){}function Xn(n){var t=++$t;return Cn(n)+t}function Yn(n){return n&&n.length?h(n,Hn,j):nt}function Zn(n){return n&&n.length?h(n,Hn,A):nt}var nt,tt="4.17.20",rt="Expected a function",et=1,ut=2,ot=1,it=32,ct=1/0,ft=9007199254740991,at="[object Arguments]",lt="[object Array]",pt="[object AsyncFunction]",st="[object Boolean]",ht="[object Date]",vt="[object Error]",yt="[object Function]",gt="[object GeneratorFunction]",_t="[object Number]",bt="[object Object]",jt="[object Proxy]",dt="[object RegExp]",mt="[object String]",Ot=/[&<>"']/g,xt=RegExp(Ot.source),wt=/^(?:0|[1-9]\d*)$/,At={ +"&":"&","<":"<",">":">",'"':""","'":"'"},Et=typeof global=="object"&&global&&global.Object===Object&&global,Nt=typeof self=="object"&&self&&self.Object===Object&&self,kt=Et||Nt||Function("return this")(),Ft=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Tt=Ft&&typeof module=="object"&&module&&!module.nodeType&&module,St=e(At),Bt=Array.prototype,It=Object.prototype,Rt=It.hasOwnProperty,$t=0,qt=It.toString,Dt=kt._,Pt=Object.create,zt=It.propertyIsEnumerable,Ct=kt.isFinite,Gt=i(Object.keys,Object),Jt=Math.max,Mt=function(){ +function n(){}return function(t){if(!Bn(t))return{};if(Pt)return Pt(t);n.prototype=t;var r=new n;return n.prototype=nt,r}}();f.prototype=Mt(c.prototype),f.prototype.constructor=f;var Ut=D(g),Vt=P(),Ht=Wn,Kt=Hn,Lt=C(nn),Qt=F(function(n,t,r){return G(n,ot|it,t,r)}),Wt=F(function(n,t){return p(n,1,t)}),Xt=F(function(n,t,r){return p(n,er(t)||0,r)}),Yt=Ht(function(){return arguments}())?Ht:function(n){return In(n)&&Rt.call(n,"callee")&&!zt.call(n,"callee")},Zt=Array.isArray,nr=d,tr=x,rr=Number,er=Number,ur=q(function(n,t){ +$(t,Gt(t),n)}),or=q(function(n,t){$(t,Q(t),n)}),ir=F(function(n,t){n=Object(n);var r=-1,e=t.length,u=e>2?t[2]:nt;for(u&&L(t[0],t[1],u)&&(e=1);++r objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/find.js b/tools/node_modules/@babel/core/node_modules/lodash/find.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/find.js rename to tools/node_modules/@babel/core/node_modules/lodash/find.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/findIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/findIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/findIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/findIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/findKey.js b/tools/node_modules/@babel/core/node_modules/lodash/findKey.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/findKey.js rename to tools/node_modules/@babel/core/node_modules/lodash/findKey.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/findLast.js b/tools/node_modules/@babel/core/node_modules/lodash/findLast.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/findLast.js rename to tools/node_modules/@babel/core/node_modules/lodash/findLast.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/findLastIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/findLastIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/findLastIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/findLastIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/findLastKey.js b/tools/node_modules/@babel/core/node_modules/lodash/findLastKey.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/findLastKey.js rename to tools/node_modules/@babel/core/node_modules/lodash/findLastKey.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/first.js b/tools/node_modules/@babel/core/node_modules/lodash/first.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/first.js rename to tools/node_modules/@babel/core/node_modules/lodash/first.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/flatMap.js b/tools/node_modules/@babel/core/node_modules/lodash/flatMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/flatMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/flatMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/flatMapDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/flatMapDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/flatMapDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/flatMapDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/flatMapDepth.js b/tools/node_modules/@babel/core/node_modules/lodash/flatMapDepth.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/flatMapDepth.js rename to tools/node_modules/@babel/core/node_modules/lodash/flatMapDepth.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/flatten.js b/tools/node_modules/@babel/core/node_modules/lodash/flatten.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/flatten.js rename to tools/node_modules/@babel/core/node_modules/lodash/flatten.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/flattenDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/flattenDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/flattenDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/flattenDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/flattenDepth.js b/tools/node_modules/@babel/core/node_modules/lodash/flattenDepth.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/flattenDepth.js rename to tools/node_modules/@babel/core/node_modules/lodash/flattenDepth.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/flip.js b/tools/node_modules/@babel/core/node_modules/lodash/flip.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/flip.js rename to tools/node_modules/@babel/core/node_modules/lodash/flip.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/floor.js b/tools/node_modules/@babel/core/node_modules/lodash/floor.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/floor.js rename to tools/node_modules/@babel/core/node_modules/lodash/floor.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/flow.js b/tools/node_modules/@babel/core/node_modules/lodash/flow.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/flow.js rename to tools/node_modules/@babel/core/node_modules/lodash/flow.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/flowRight.js b/tools/node_modules/@babel/core/node_modules/lodash/flowRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/flowRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/flowRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/forEach.js b/tools/node_modules/@babel/core/node_modules/lodash/forEach.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/forEach.js rename to tools/node_modules/@babel/core/node_modules/lodash/forEach.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/forEachRight.js b/tools/node_modules/@babel/core/node_modules/lodash/forEachRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/forEachRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/forEachRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/forIn.js b/tools/node_modules/@babel/core/node_modules/lodash/forIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/forIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/forIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/forInRight.js b/tools/node_modules/@babel/core/node_modules/lodash/forInRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/forInRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/forInRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/forOwn.js b/tools/node_modules/@babel/core/node_modules/lodash/forOwn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/forOwn.js rename to tools/node_modules/@babel/core/node_modules/lodash/forOwn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/forOwnRight.js b/tools/node_modules/@babel/core/node_modules/lodash/forOwnRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/forOwnRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/forOwnRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp.js b/tools/node_modules/@babel/core/node_modules/lodash/fp.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/F.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/F.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/F.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/F.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/T.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/T.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/T.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/T.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/__.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/__.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/__.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/__.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/_baseConvert.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/_baseConvert.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/_baseConvert.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/_baseConvert.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/_convertBrowser.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/_convertBrowser.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/_convertBrowser.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/_convertBrowser.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/_falseOptions.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/_falseOptions.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/_falseOptions.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/_falseOptions.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/_mapping.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/_mapping.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/_mapping.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/_mapping.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/_util.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/_util.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/_util.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/_util.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/add.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/add.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/add.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/add.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/after.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/after.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/after.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/after.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/all.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/all.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/all.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/all.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/allPass.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/allPass.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/allPass.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/allPass.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/always.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/always.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/always.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/always.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/any.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/any.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/any.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/any.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/anyPass.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/anyPass.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/anyPass.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/anyPass.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/apply.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/apply.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/apply.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/apply.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/array.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/array.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/array.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/array.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/ary.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/ary.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/ary.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/ary.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/assign.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/assign.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/assign.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/assign.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/assignAll.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/assignAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/assignAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/assignAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/assignAllWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/assignAllWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/assignAllWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/assignAllWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/assignIn.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/assignIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/assignIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/assignIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/assignInAll.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/assignInAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/assignInAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/assignInAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/assignInAllWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/assignInAllWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/assignInAllWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/assignInAllWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/assignInWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/assignInWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/assignInWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/assignInWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/assignWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/assignWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/assignWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/assignWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/assoc.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/assoc.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/assoc.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/assoc.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/assocPath.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/assocPath.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/assocPath.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/assocPath.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/at.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/at.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/at.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/at.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/attempt.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/attempt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/attempt.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/attempt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/before.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/before.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/before.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/before.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/bind.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/bind.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/bind.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/bind.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/bindAll.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/bindAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/bindAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/bindAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/bindKey.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/bindKey.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/bindKey.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/bindKey.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/camelCase.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/camelCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/camelCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/camelCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/capitalize.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/capitalize.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/capitalize.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/capitalize.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/castArray.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/castArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/castArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/castArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/ceil.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/ceil.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/ceil.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/ceil.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/chain.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/chain.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/chain.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/chain.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/chunk.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/chunk.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/chunk.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/chunk.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/clamp.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/clamp.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/clamp.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/clamp.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/clone.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/clone.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/clone.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/clone.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/cloneDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/cloneDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/cloneDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/cloneDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/cloneDeepWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/cloneDeepWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/cloneDeepWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/cloneDeepWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/cloneWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/cloneWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/cloneWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/cloneWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/collection.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/collection.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/collection.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/collection.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/commit.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/commit.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/commit.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/commit.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/compact.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/compact.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/compact.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/compact.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/complement.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/complement.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/complement.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/complement.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/compose.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/compose.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/compose.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/compose.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/concat.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/concat.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/concat.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/concat.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/cond.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/cond.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/cond.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/cond.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/conforms.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/conforms.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/conforms.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/conforms.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/conformsTo.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/conformsTo.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/conformsTo.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/conformsTo.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/constant.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/constant.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/constant.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/constant.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/contains.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/contains.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/contains.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/contains.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/convert.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/convert.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/convert.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/convert.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/countBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/countBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/countBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/countBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/create.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/create.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/create.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/create.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/curry.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/curry.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/curry.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/curry.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/curryN.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/curryN.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/curryN.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/curryN.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/curryRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/curryRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/curryRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/curryRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/curryRightN.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/curryRightN.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/curryRightN.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/curryRightN.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/date.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/date.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/date.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/date.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/debounce.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/debounce.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/debounce.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/debounce.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/deburr.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/deburr.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/deburr.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/deburr.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/defaultTo.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/defaultTo.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/defaultTo.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/defaultTo.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/defaults.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/defaults.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/defaults.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/defaults.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/defaultsAll.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/defaultsAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/defaultsAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/defaultsAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/defaultsDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/defaultsDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/defaultsDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/defaultsDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/defaultsDeepAll.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/defaultsDeepAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/defaultsDeepAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/defaultsDeepAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/defer.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/defer.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/defer.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/defer.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/delay.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/delay.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/delay.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/delay.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/difference.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/difference.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/difference.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/difference.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/differenceBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/differenceBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/differenceBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/differenceBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/differenceWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/differenceWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/differenceWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/differenceWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/dissoc.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/dissoc.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/dissoc.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/dissoc.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/dissocPath.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/dissocPath.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/dissocPath.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/dissocPath.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/divide.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/divide.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/divide.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/divide.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/drop.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/drop.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/drop.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/drop.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/dropLast.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/dropLast.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/dropLast.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/dropLast.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/dropLastWhile.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/dropLastWhile.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/dropLastWhile.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/dropLastWhile.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/dropRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/dropRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/dropRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/dropRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/dropRightWhile.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/dropRightWhile.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/dropRightWhile.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/dropRightWhile.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/dropWhile.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/dropWhile.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/dropWhile.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/dropWhile.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/each.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/each.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/each.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/each.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/eachRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/eachRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/eachRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/eachRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/endsWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/endsWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/endsWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/endsWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/entries.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/entries.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/entries.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/entries.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/entriesIn.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/entriesIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/entriesIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/entriesIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/eq.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/eq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/eq.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/eq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/equals.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/equals.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/equals.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/equals.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/escape.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/escape.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/escape.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/escape.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/escapeRegExp.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/escapeRegExp.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/escapeRegExp.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/escapeRegExp.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/every.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/every.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/every.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/every.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/extend.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/extend.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/extend.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/extend.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/extendAll.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/extendAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/extendAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/extendAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/extendAllWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/extendAllWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/extendAllWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/extendAllWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/extendWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/extendWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/extendWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/extendWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/fill.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/fill.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/fill.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/fill.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/filter.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/filter.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/filter.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/filter.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/find.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/find.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/find.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/find.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/findFrom.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/findFrom.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/findFrom.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/findFrom.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/findIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/findIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/findIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/findIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/findIndexFrom.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/findIndexFrom.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/findIndexFrom.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/findIndexFrom.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/findKey.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/findKey.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/findKey.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/findKey.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/findLast.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/findLast.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/findLast.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/findLast.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/findLastFrom.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/findLastFrom.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/findLastFrom.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/findLastFrom.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/findLastIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/findLastIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/findLastIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/findLastIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/findLastIndexFrom.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/findLastIndexFrom.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/findLastIndexFrom.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/findLastIndexFrom.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/findLastKey.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/findLastKey.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/findLastKey.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/findLastKey.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/first.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/first.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/first.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/first.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/flatMap.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/flatMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/flatMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/flatMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/flatMapDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/flatMapDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/flatMapDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/flatMapDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/flatMapDepth.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/flatMapDepth.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/flatMapDepth.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/flatMapDepth.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/flatten.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/flatten.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/flatten.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/flatten.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/flattenDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/flattenDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/flattenDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/flattenDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/flattenDepth.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/flattenDepth.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/flattenDepth.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/flattenDepth.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/flip.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/flip.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/flip.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/flip.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/floor.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/floor.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/floor.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/floor.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/flow.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/flow.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/flow.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/flow.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/flowRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/flowRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/flowRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/flowRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/forEach.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/forEach.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/forEach.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/forEach.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/forEachRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/forEachRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/forEachRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/forEachRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/forIn.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/forIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/forIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/forIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/forInRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/forInRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/forInRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/forInRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/forOwn.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/forOwn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/forOwn.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/forOwn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/forOwnRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/forOwnRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/forOwnRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/forOwnRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/fromPairs.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/fromPairs.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/fromPairs.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/fromPairs.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/function.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/function.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/function.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/function.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/functions.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/functions.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/functions.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/functions.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/functionsIn.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/functionsIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/functionsIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/functionsIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/get.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/get.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/get.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/get.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/getOr.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/getOr.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/getOr.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/getOr.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/groupBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/groupBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/groupBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/groupBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/gt.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/gt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/gt.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/gt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/gte.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/gte.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/gte.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/gte.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/has.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/has.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/has.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/has.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/hasIn.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/hasIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/hasIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/hasIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/head.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/head.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/head.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/head.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/identical.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/identical.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/identical.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/identical.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/identity.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/identity.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/identity.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/identity.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/inRange.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/inRange.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/inRange.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/inRange.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/includes.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/includes.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/includes.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/includes.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/includesFrom.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/includesFrom.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/includesFrom.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/includesFrom.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/indexBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/indexBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/indexBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/indexBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/indexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/indexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/indexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/indexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/indexOfFrom.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/indexOfFrom.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/indexOfFrom.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/indexOfFrom.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/init.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/init.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/init.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/init.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/initial.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/initial.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/initial.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/initial.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/intersection.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/intersection.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/intersection.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/intersection.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/intersectionBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/intersectionBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/intersectionBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/intersectionBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/intersectionWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/intersectionWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/intersectionWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/intersectionWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/invert.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/invert.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/invert.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/invert.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/invertBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/invertBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/invertBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/invertBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/invertObj.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/invertObj.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/invertObj.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/invertObj.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/invoke.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/invoke.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/invoke.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/invoke.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/invokeArgs.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/invokeArgs.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/invokeArgs.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/invokeArgs.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/invokeArgsMap.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/invokeArgsMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/invokeArgsMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/invokeArgsMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/invokeMap.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/invokeMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/invokeMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/invokeMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isArguments.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isArguments.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isArguments.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isArguments.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isArray.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isArrayBuffer.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isArrayBuffer.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isArrayBuffer.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isArrayBuffer.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isArrayLike.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isArrayLike.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isArrayLike.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isArrayLike.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isArrayLikeObject.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isArrayLikeObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isArrayLikeObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isArrayLikeObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isBoolean.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isBoolean.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isBoolean.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isBoolean.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isBuffer.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isBuffer.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isBuffer.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isBuffer.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isDate.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isDate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isDate.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isDate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isElement.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isElement.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isElement.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isElement.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isEmpty.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isEmpty.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isEmpty.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isEmpty.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isEqual.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isEqual.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isEqual.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isEqual.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isEqualWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isEqualWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isEqualWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isEqualWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isError.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isError.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isError.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isError.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isFinite.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isFinite.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isFinite.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isFinite.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isFunction.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isFunction.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isFunction.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isFunction.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isInteger.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isInteger.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isInteger.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isInteger.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isLength.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isLength.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isLength.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isLength.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isMap.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isMatch.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isMatch.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isMatch.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isMatch.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isMatchWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isMatchWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isMatchWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isMatchWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isNaN.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isNaN.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isNaN.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isNaN.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isNative.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isNative.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isNative.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isNative.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isNil.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isNil.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isNil.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isNil.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isNull.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isNull.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isNull.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isNull.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isNumber.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isNumber.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isNumber.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isNumber.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isObject.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isObjectLike.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isObjectLike.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isObjectLike.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isObjectLike.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isPlainObject.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isPlainObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isPlainObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isPlainObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isRegExp.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isRegExp.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isRegExp.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isRegExp.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isSafeInteger.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isSafeInteger.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isSafeInteger.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isSafeInteger.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isSet.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isSet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isSet.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isSet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isString.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isString.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isString.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isString.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isSymbol.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isSymbol.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isSymbol.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isSymbol.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isTypedArray.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isTypedArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isTypedArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isTypedArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isUndefined.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isUndefined.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isUndefined.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isUndefined.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isWeakMap.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isWeakMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isWeakMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isWeakMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/isWeakSet.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/isWeakSet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/isWeakSet.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/isWeakSet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/iteratee.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/iteratee.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/iteratee.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/iteratee.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/join.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/join.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/join.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/join.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/juxt.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/juxt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/juxt.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/juxt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/kebabCase.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/kebabCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/kebabCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/kebabCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/keyBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/keyBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/keyBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/keyBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/keys.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/keys.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/keys.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/keys.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/keysIn.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/keysIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/keysIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/keysIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/lang.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/lang.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/lang.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/lang.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/last.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/last.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/last.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/last.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/lastIndexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/lastIndexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/lastIndexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/lastIndexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/lastIndexOfFrom.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/lastIndexOfFrom.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/lastIndexOfFrom.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/lastIndexOfFrom.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/lowerCase.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/lowerCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/lowerCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/lowerCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/lowerFirst.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/lowerFirst.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/lowerFirst.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/lowerFirst.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/lt.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/lt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/lt.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/lt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/lte.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/lte.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/lte.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/lte.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/map.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/map.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/map.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/map.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/mapKeys.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/mapKeys.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/mapKeys.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/mapKeys.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/mapValues.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/mapValues.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/mapValues.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/mapValues.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/matches.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/matches.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/matches.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/matches.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/matchesProperty.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/matchesProperty.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/matchesProperty.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/matchesProperty.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/math.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/math.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/math.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/math.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/max.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/max.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/max.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/max.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/maxBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/maxBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/maxBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/maxBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/mean.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/mean.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/mean.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/mean.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/meanBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/meanBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/meanBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/meanBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/memoize.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/memoize.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/memoize.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/memoize.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/merge.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/merge.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/merge.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/merge.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/mergeAll.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/mergeAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/mergeAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/mergeAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/mergeAllWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/mergeAllWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/mergeAllWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/mergeAllWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/mergeWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/mergeWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/mergeWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/mergeWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/method.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/method.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/method.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/method.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/methodOf.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/methodOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/methodOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/methodOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/min.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/min.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/min.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/min.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/minBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/minBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/minBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/minBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/mixin.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/mixin.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/mixin.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/mixin.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/multiply.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/multiply.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/multiply.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/multiply.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/nAry.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/nAry.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/nAry.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/nAry.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/negate.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/negate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/negate.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/negate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/next.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/next.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/next.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/next.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/noop.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/noop.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/noop.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/noop.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/now.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/now.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/now.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/now.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/nth.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/nth.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/nth.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/nth.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/nthArg.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/nthArg.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/nthArg.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/nthArg.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/number.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/number.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/number.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/number.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/object.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/object.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/object.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/object.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/omit.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/omit.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/omit.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/omit.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/omitAll.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/omitAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/omitAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/omitAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/omitBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/omitBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/omitBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/omitBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/once.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/once.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/once.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/once.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/orderBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/orderBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/orderBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/orderBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/over.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/over.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/over.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/over.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/overArgs.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/overArgs.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/overArgs.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/overArgs.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/overEvery.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/overEvery.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/overEvery.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/overEvery.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/overSome.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/overSome.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/overSome.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/overSome.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pad.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pad.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pad.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pad.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/padChars.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/padChars.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/padChars.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/padChars.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/padCharsEnd.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/padCharsEnd.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/padCharsEnd.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/padCharsEnd.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/padCharsStart.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/padCharsStart.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/padCharsStart.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/padCharsStart.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/padEnd.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/padEnd.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/padEnd.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/padEnd.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/padStart.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/padStart.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/padStart.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/padStart.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/parseInt.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/parseInt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/parseInt.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/parseInt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/partial.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/partial.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/partial.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/partial.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/partialRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/partialRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/partialRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/partialRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/partition.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/partition.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/partition.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/partition.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/path.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/path.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/path.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/path.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pathEq.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pathEq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pathEq.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pathEq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pathOr.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pathOr.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pathOr.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pathOr.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/paths.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/paths.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/paths.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/paths.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pick.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pick.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pick.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pick.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pickAll.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pickAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pickAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pickAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pickBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pickBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pickBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pickBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pipe.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pipe.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pipe.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pipe.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/placeholder.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/placeholder.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/placeholder.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/placeholder.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/plant.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/plant.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/plant.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/plant.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pluck.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pluck.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pluck.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pluck.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/prop.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/prop.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/prop.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/prop.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/propEq.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/propEq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/propEq.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/propEq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/propOr.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/propOr.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/propOr.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/propOr.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/property.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/property.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/property.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/property.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/propertyOf.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/propertyOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/propertyOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/propertyOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/props.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/props.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/props.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/props.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pull.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pull.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pull.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pull.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pullAll.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pullAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pullAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pullAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pullAllBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pullAllBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pullAllBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pullAllBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pullAllWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pullAllWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pullAllWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pullAllWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/pullAt.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/pullAt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/pullAt.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/pullAt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/random.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/random.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/random.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/random.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/range.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/range.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/range.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/range.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/rangeRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/rangeRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/rangeRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/rangeRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/rangeStep.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/rangeStep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/rangeStep.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/rangeStep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/rangeStepRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/rangeStepRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/rangeStepRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/rangeStepRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/rearg.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/rearg.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/rearg.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/rearg.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/reduce.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/reduce.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/reduce.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/reduce.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/reduceRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/reduceRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/reduceRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/reduceRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/reject.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/reject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/reject.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/reject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/remove.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/remove.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/remove.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/remove.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/repeat.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/repeat.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/repeat.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/repeat.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/replace.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/replace.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/replace.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/replace.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/rest.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/rest.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/rest.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/rest.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/restFrom.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/restFrom.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/restFrom.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/restFrom.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/result.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/result.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/result.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/result.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/reverse.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/reverse.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/reverse.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/reverse.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/round.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/round.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/round.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/round.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sample.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sample.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sample.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sample.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sampleSize.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sampleSize.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sampleSize.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sampleSize.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/seq.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/seq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/seq.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/seq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/set.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/set.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/set.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/set.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/setWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/setWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/setWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/setWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/shuffle.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/shuffle.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/shuffle.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/shuffle.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/size.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/size.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/size.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/size.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/slice.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/slice.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/slice.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/slice.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/snakeCase.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/snakeCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/snakeCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/snakeCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/some.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/some.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/some.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/some.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sortBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sortBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sortBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sortBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sortedIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sortedIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedIndexBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sortedIndexBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedIndexBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sortedIndexBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedIndexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sortedIndexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedIndexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sortedIndexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedLastIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sortedLastIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedLastIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sortedLastIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedLastIndexBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sortedLastIndexBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedLastIndexBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sortedLastIndexBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedLastIndexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sortedLastIndexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedLastIndexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sortedLastIndexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedUniq.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sortedUniq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedUniq.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sortedUniq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedUniqBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sortedUniqBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sortedUniqBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sortedUniqBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/split.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/split.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/split.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/split.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/spread.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/spread.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/spread.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/spread.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/spreadFrom.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/spreadFrom.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/spreadFrom.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/spreadFrom.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/startCase.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/startCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/startCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/startCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/startsWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/startsWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/startsWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/startsWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/string.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/string.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/string.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/string.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/stubArray.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/stubArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/stubArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/stubArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/stubFalse.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/stubFalse.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/stubFalse.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/stubFalse.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/stubObject.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/stubObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/stubObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/stubObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/stubString.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/stubString.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/stubString.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/stubString.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/stubTrue.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/stubTrue.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/stubTrue.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/stubTrue.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/subtract.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/subtract.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/subtract.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/subtract.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sum.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sum.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sum.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sum.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/sumBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/sumBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/sumBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/sumBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/symmetricDifference.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/symmetricDifference.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/symmetricDifference.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/symmetricDifference.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/symmetricDifferenceBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/symmetricDifferenceBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/symmetricDifferenceBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/symmetricDifferenceBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/symmetricDifferenceWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/symmetricDifferenceWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/symmetricDifferenceWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/symmetricDifferenceWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/tail.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/tail.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/tail.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/tail.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/take.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/take.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/take.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/take.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/takeLast.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/takeLast.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/takeLast.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/takeLast.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/takeLastWhile.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/takeLastWhile.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/takeLastWhile.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/takeLastWhile.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/takeRight.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/takeRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/takeRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/takeRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/takeRightWhile.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/takeRightWhile.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/takeRightWhile.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/takeRightWhile.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/takeWhile.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/takeWhile.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/takeWhile.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/takeWhile.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/tap.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/tap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/tap.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/tap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/template.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/template.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/template.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/template.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/templateSettings.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/templateSettings.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/templateSettings.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/templateSettings.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/throttle.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/throttle.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/throttle.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/throttle.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/thru.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/thru.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/thru.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/thru.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/times.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/times.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/times.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/times.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toArray.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toFinite.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toFinite.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toFinite.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toFinite.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toInteger.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toInteger.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toInteger.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toInteger.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toIterator.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toIterator.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toIterator.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toIterator.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toJSON.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toJSON.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toJSON.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toJSON.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toLength.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toLength.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toLength.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toLength.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toLower.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toLower.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toLower.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toLower.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toNumber.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toNumber.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toNumber.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toNumber.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toPairs.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toPairs.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toPairs.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toPairs.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toPairsIn.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toPairsIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toPairsIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toPairsIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toPath.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toPath.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toPath.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toPath.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toPlainObject.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toPlainObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toPlainObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toPlainObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toSafeInteger.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toSafeInteger.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toSafeInteger.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toSafeInteger.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toString.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toString.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toString.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toString.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/toUpper.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/toUpper.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/toUpper.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/toUpper.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/transform.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/transform.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/transform.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/transform.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/trim.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/trim.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/trim.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/trim.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/trimChars.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/trimChars.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/trimChars.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/trimChars.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/trimCharsEnd.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/trimCharsEnd.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/trimCharsEnd.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/trimCharsEnd.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/trimCharsStart.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/trimCharsStart.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/trimCharsStart.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/trimCharsStart.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/trimEnd.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/trimEnd.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/trimEnd.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/trimEnd.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/trimStart.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/trimStart.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/trimStart.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/trimStart.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/truncate.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/truncate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/truncate.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/truncate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/unapply.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/unapply.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/unapply.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/unapply.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/unary.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/unary.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/unary.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/unary.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/unescape.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/unescape.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/unescape.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/unescape.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/union.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/union.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/union.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/union.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/unionBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/unionBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/unionBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/unionBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/unionWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/unionWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/unionWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/unionWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/uniq.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/uniq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/uniq.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/uniq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/uniqBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/uniqBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/uniqBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/uniqBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/uniqWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/uniqWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/uniqWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/uniqWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/uniqueId.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/uniqueId.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/uniqueId.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/uniqueId.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/unnest.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/unnest.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/unnest.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/unnest.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/unset.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/unset.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/unset.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/unset.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/unzip.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/unzip.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/unzip.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/unzip.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/unzipWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/unzipWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/unzipWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/unzipWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/update.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/update.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/update.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/update.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/updateWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/updateWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/updateWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/updateWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/upperCase.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/upperCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/upperCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/upperCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/upperFirst.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/upperFirst.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/upperFirst.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/upperFirst.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/useWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/useWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/useWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/useWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/util.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/util.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/util.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/util.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/value.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/value.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/value.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/value.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/valueOf.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/valueOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/valueOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/valueOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/values.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/values.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/values.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/values.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/valuesIn.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/valuesIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/valuesIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/valuesIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/where.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/where.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/where.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/where.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/whereEq.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/whereEq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/whereEq.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/whereEq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/without.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/without.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/without.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/without.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/words.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/words.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/words.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/words.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/wrap.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/wrap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/wrap.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/wrap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/wrapperAt.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/wrapperAt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/wrapperAt.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/wrapperAt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/wrapperChain.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/wrapperChain.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/wrapperChain.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/wrapperChain.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/wrapperLodash.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/wrapperLodash.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/wrapperLodash.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/wrapperLodash.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/wrapperReverse.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/wrapperReverse.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/wrapperReverse.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/wrapperReverse.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/wrapperValue.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/wrapperValue.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/wrapperValue.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/wrapperValue.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/xor.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/xor.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/xor.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/xor.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/xorBy.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/xorBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/xorBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/xorBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/xorWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/xorWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/xorWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/xorWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/zip.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/zip.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/zip.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/zip.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/zipAll.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/zipAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/zipAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/zipAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/zipObj.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/zipObj.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/zipObj.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/zipObj.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/zipObject.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/zipObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/zipObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/zipObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/zipObjectDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/zipObjectDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/zipObjectDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/zipObjectDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fp/zipWith.js b/tools/node_modules/@babel/core/node_modules/lodash/fp/zipWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fp/zipWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/fp/zipWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/fromPairs.js b/tools/node_modules/@babel/core/node_modules/lodash/fromPairs.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/fromPairs.js rename to tools/node_modules/@babel/core/node_modules/lodash/fromPairs.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/function.js b/tools/node_modules/@babel/core/node_modules/lodash/function.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/function.js rename to tools/node_modules/@babel/core/node_modules/lodash/function.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/functions.js b/tools/node_modules/@babel/core/node_modules/lodash/functions.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/functions.js rename to tools/node_modules/@babel/core/node_modules/lodash/functions.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/functionsIn.js b/tools/node_modules/@babel/core/node_modules/lodash/functionsIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/functionsIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/functionsIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/get.js b/tools/node_modules/@babel/core/node_modules/lodash/get.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/get.js rename to tools/node_modules/@babel/core/node_modules/lodash/get.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/groupBy.js b/tools/node_modules/@babel/core/node_modules/lodash/groupBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/groupBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/groupBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/gt.js b/tools/node_modules/@babel/core/node_modules/lodash/gt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/gt.js rename to tools/node_modules/@babel/core/node_modules/lodash/gt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/gte.js b/tools/node_modules/@babel/core/node_modules/lodash/gte.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/gte.js rename to tools/node_modules/@babel/core/node_modules/lodash/gte.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/has.js b/tools/node_modules/@babel/core/node_modules/lodash/has.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/has.js rename to tools/node_modules/@babel/core/node_modules/lodash/has.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/hasIn.js b/tools/node_modules/@babel/core/node_modules/lodash/hasIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/hasIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/hasIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/head.js b/tools/node_modules/@babel/core/node_modules/lodash/head.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/head.js rename to tools/node_modules/@babel/core/node_modules/lodash/head.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/identity.js b/tools/node_modules/@babel/core/node_modules/lodash/identity.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/identity.js rename to tools/node_modules/@babel/core/node_modules/lodash/identity.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/inRange.js b/tools/node_modules/@babel/core/node_modules/lodash/inRange.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/inRange.js rename to tools/node_modules/@babel/core/node_modules/lodash/inRange.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/includes.js b/tools/node_modules/@babel/core/node_modules/lodash/includes.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/includes.js rename to tools/node_modules/@babel/core/node_modules/lodash/includes.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/index.js b/tools/node_modules/@babel/core/node_modules/lodash/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/index.js rename to tools/node_modules/@babel/core/node_modules/lodash/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/indexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/indexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/indexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/indexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/initial.js b/tools/node_modules/@babel/core/node_modules/lodash/initial.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/initial.js rename to tools/node_modules/@babel/core/node_modules/lodash/initial.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/intersection.js b/tools/node_modules/@babel/core/node_modules/lodash/intersection.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/intersection.js rename to tools/node_modules/@babel/core/node_modules/lodash/intersection.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/intersectionBy.js b/tools/node_modules/@babel/core/node_modules/lodash/intersectionBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/intersectionBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/intersectionBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/intersectionWith.js b/tools/node_modules/@babel/core/node_modules/lodash/intersectionWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/intersectionWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/intersectionWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/invert.js b/tools/node_modules/@babel/core/node_modules/lodash/invert.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/invert.js rename to tools/node_modules/@babel/core/node_modules/lodash/invert.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/invertBy.js b/tools/node_modules/@babel/core/node_modules/lodash/invertBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/invertBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/invertBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/invoke.js b/tools/node_modules/@babel/core/node_modules/lodash/invoke.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/invoke.js rename to tools/node_modules/@babel/core/node_modules/lodash/invoke.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/invokeMap.js b/tools/node_modules/@babel/core/node_modules/lodash/invokeMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/invokeMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/invokeMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isArguments.js b/tools/node_modules/@babel/core/node_modules/lodash/isArguments.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isArguments.js rename to tools/node_modules/@babel/core/node_modules/lodash/isArguments.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isArray.js b/tools/node_modules/@babel/core/node_modules/lodash/isArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/isArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isArrayBuffer.js b/tools/node_modules/@babel/core/node_modules/lodash/isArrayBuffer.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isArrayBuffer.js rename to tools/node_modules/@babel/core/node_modules/lodash/isArrayBuffer.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isArrayLike.js b/tools/node_modules/@babel/core/node_modules/lodash/isArrayLike.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isArrayLike.js rename to tools/node_modules/@babel/core/node_modules/lodash/isArrayLike.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isArrayLikeObject.js b/tools/node_modules/@babel/core/node_modules/lodash/isArrayLikeObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isArrayLikeObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/isArrayLikeObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isBoolean.js b/tools/node_modules/@babel/core/node_modules/lodash/isBoolean.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isBoolean.js rename to tools/node_modules/@babel/core/node_modules/lodash/isBoolean.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isBuffer.js b/tools/node_modules/@babel/core/node_modules/lodash/isBuffer.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isBuffer.js rename to tools/node_modules/@babel/core/node_modules/lodash/isBuffer.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isDate.js b/tools/node_modules/@babel/core/node_modules/lodash/isDate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isDate.js rename to tools/node_modules/@babel/core/node_modules/lodash/isDate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isElement.js b/tools/node_modules/@babel/core/node_modules/lodash/isElement.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isElement.js rename to tools/node_modules/@babel/core/node_modules/lodash/isElement.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isEmpty.js b/tools/node_modules/@babel/core/node_modules/lodash/isEmpty.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isEmpty.js rename to tools/node_modules/@babel/core/node_modules/lodash/isEmpty.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isEqual.js b/tools/node_modules/@babel/core/node_modules/lodash/isEqual.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isEqual.js rename to tools/node_modules/@babel/core/node_modules/lodash/isEqual.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isEqualWith.js b/tools/node_modules/@babel/core/node_modules/lodash/isEqualWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isEqualWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/isEqualWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isError.js b/tools/node_modules/@babel/core/node_modules/lodash/isError.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isError.js rename to tools/node_modules/@babel/core/node_modules/lodash/isError.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isFinite.js b/tools/node_modules/@babel/core/node_modules/lodash/isFinite.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isFinite.js rename to tools/node_modules/@babel/core/node_modules/lodash/isFinite.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isFunction.js b/tools/node_modules/@babel/core/node_modules/lodash/isFunction.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isFunction.js rename to tools/node_modules/@babel/core/node_modules/lodash/isFunction.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isInteger.js b/tools/node_modules/@babel/core/node_modules/lodash/isInteger.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isInteger.js rename to tools/node_modules/@babel/core/node_modules/lodash/isInteger.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isLength.js b/tools/node_modules/@babel/core/node_modules/lodash/isLength.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isLength.js rename to tools/node_modules/@babel/core/node_modules/lodash/isLength.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isMap.js b/tools/node_modules/@babel/core/node_modules/lodash/isMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/isMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isMatch.js b/tools/node_modules/@babel/core/node_modules/lodash/isMatch.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isMatch.js rename to tools/node_modules/@babel/core/node_modules/lodash/isMatch.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isMatchWith.js b/tools/node_modules/@babel/core/node_modules/lodash/isMatchWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isMatchWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/isMatchWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isNaN.js b/tools/node_modules/@babel/core/node_modules/lodash/isNaN.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isNaN.js rename to tools/node_modules/@babel/core/node_modules/lodash/isNaN.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isNative.js b/tools/node_modules/@babel/core/node_modules/lodash/isNative.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isNative.js rename to tools/node_modules/@babel/core/node_modules/lodash/isNative.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isNil.js b/tools/node_modules/@babel/core/node_modules/lodash/isNil.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isNil.js rename to tools/node_modules/@babel/core/node_modules/lodash/isNil.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isNull.js b/tools/node_modules/@babel/core/node_modules/lodash/isNull.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isNull.js rename to tools/node_modules/@babel/core/node_modules/lodash/isNull.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isNumber.js b/tools/node_modules/@babel/core/node_modules/lodash/isNumber.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isNumber.js rename to tools/node_modules/@babel/core/node_modules/lodash/isNumber.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isObject.js b/tools/node_modules/@babel/core/node_modules/lodash/isObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/isObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isObjectLike.js b/tools/node_modules/@babel/core/node_modules/lodash/isObjectLike.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isObjectLike.js rename to tools/node_modules/@babel/core/node_modules/lodash/isObjectLike.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isPlainObject.js b/tools/node_modules/@babel/core/node_modules/lodash/isPlainObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isPlainObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/isPlainObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isRegExp.js b/tools/node_modules/@babel/core/node_modules/lodash/isRegExp.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isRegExp.js rename to tools/node_modules/@babel/core/node_modules/lodash/isRegExp.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isSafeInteger.js b/tools/node_modules/@babel/core/node_modules/lodash/isSafeInteger.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isSafeInteger.js rename to tools/node_modules/@babel/core/node_modules/lodash/isSafeInteger.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isSet.js b/tools/node_modules/@babel/core/node_modules/lodash/isSet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isSet.js rename to tools/node_modules/@babel/core/node_modules/lodash/isSet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isString.js b/tools/node_modules/@babel/core/node_modules/lodash/isString.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isString.js rename to tools/node_modules/@babel/core/node_modules/lodash/isString.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isSymbol.js b/tools/node_modules/@babel/core/node_modules/lodash/isSymbol.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isSymbol.js rename to tools/node_modules/@babel/core/node_modules/lodash/isSymbol.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isTypedArray.js b/tools/node_modules/@babel/core/node_modules/lodash/isTypedArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isTypedArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/isTypedArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isUndefined.js b/tools/node_modules/@babel/core/node_modules/lodash/isUndefined.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isUndefined.js rename to tools/node_modules/@babel/core/node_modules/lodash/isUndefined.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isWeakMap.js b/tools/node_modules/@babel/core/node_modules/lodash/isWeakMap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isWeakMap.js rename to tools/node_modules/@babel/core/node_modules/lodash/isWeakMap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/isWeakSet.js b/tools/node_modules/@babel/core/node_modules/lodash/isWeakSet.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/isWeakSet.js rename to tools/node_modules/@babel/core/node_modules/lodash/isWeakSet.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/iteratee.js b/tools/node_modules/@babel/core/node_modules/lodash/iteratee.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/iteratee.js rename to tools/node_modules/@babel/core/node_modules/lodash/iteratee.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/join.js b/tools/node_modules/@babel/core/node_modules/lodash/join.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/join.js rename to tools/node_modules/@babel/core/node_modules/lodash/join.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/kebabCase.js b/tools/node_modules/@babel/core/node_modules/lodash/kebabCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/kebabCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/kebabCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/keyBy.js b/tools/node_modules/@babel/core/node_modules/lodash/keyBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/keyBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/keyBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/keys.js b/tools/node_modules/@babel/core/node_modules/lodash/keys.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/keys.js rename to tools/node_modules/@babel/core/node_modules/lodash/keys.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/keysIn.js b/tools/node_modules/@babel/core/node_modules/lodash/keysIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/keysIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/keysIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/lang.js b/tools/node_modules/@babel/core/node_modules/lodash/lang.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/lang.js rename to tools/node_modules/@babel/core/node_modules/lodash/lang.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/last.js b/tools/node_modules/@babel/core/node_modules/lodash/last.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/last.js rename to tools/node_modules/@babel/core/node_modules/lodash/last.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/lastIndexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/lastIndexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/lastIndexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/lastIndexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/lodash.js b/tools/node_modules/@babel/core/node_modules/lodash/lodash.js similarity index 99% rename from tools/node_modules/babel-eslint/node_modules/lodash/lodash.js rename to tools/node_modules/@babel/core/node_modules/lodash/lodash.js index 9b95dfefe87f73..1fd7116f426a28 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/lodash.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/lodash.js @@ -12,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.17.15'; + var VERSION = '4.17.20'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -3719,8 +3719,21 @@ * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + var index = -1; - iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { @@ -3977,6 +3990,10 @@ var key = toKey(path[index]), newValue = value; + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; @@ -4129,11 +4146,14 @@ * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); - var low = 0, - high = array == null ? 0 : array.length, - valIsNaN = value !== value, + high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } + + value = iteratee(value); + var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined; @@ -5618,10 +5638,11 @@ if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked && stack.get(other)) { - return stacked == other; + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; } var index = -1, result = true, @@ -5783,10 +5804,11 @@ return false; } } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked && stack.get(other)) { - return stacked == other; + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; } var result = true; stack.set(object, other); @@ -9167,6 +9189,10 @@ * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; @@ -9916,15 +9942,15 @@ * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, + * { 'user': 'fred', 'age': 30 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] * * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { @@ -14799,11 +14825,11 @@ // Use a sourceURL for easier debugging. // The sourceURL gets injected into the source that's eval-ed, so be careful - // with lookup (in case of e.g. prototype pollution), and strip newlines if any. - // A newline wouldn't be a valid sourceURL anyway, and it'd enable code injection. + // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in + // and escape the comment, thus injecting code that gets evaled. var sourceURL = '//# sourceURL=' + (hasOwnProperty.call(options, 'sourceURL') - ? (options.sourceURL + '').replace(/[\r\n]/g, ' ') + ? (options.sourceURL + '').replace(/\s/g, ' ') : ('lodash.templateSources[' + (++templateCounter) + ']') ) + '\n'; @@ -14836,8 +14862,6 @@ // If `variable` is not specified wrap a with-statement around the generated // code to add the data object to the top of the scope chain. - // Like with sourceURL, we take care to not check the option's prototype, - // as this configuration is a code injection vector. var variable = hasOwnProperty.call(options, 'variable') && options.variable; if (!variable) { source = 'with (obj) {\n' + source + '\n}\n'; @@ -15544,6 +15568,9 @@ * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * + * **Note:** Multiple values can be checked by combining several matchers + * using `_.overSome` + * * @static * @memberOf _ * @since 3.0.0 @@ -15559,6 +15586,10 @@ * * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); * // => [{ 'a': 4, 'b': 5, 'c': 6 }] + * + * // Checking for several possible values + * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); + * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] */ function matches(source) { return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); @@ -15573,6 +15604,9 @@ * `srcValue` values against any array or object value, respectively. See * `_.isEqual` for a list of supported value comparisons. * + * **Note:** Multiple values can be checked by combining several matchers + * using `_.overSome` + * * @static * @memberOf _ * @since 3.2.0 @@ -15589,6 +15623,10 @@ * * _.find(objects, _.matchesProperty('a', 4)); * // => { 'a': 4, 'b': 5, 'c': 6 } + * + * // Checking for several possible values + * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); + * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] */ function matchesProperty(path, srcValue) { return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); @@ -15812,6 +15850,10 @@ * Creates a function that checks if **all** of the `predicates` return * truthy when invoked with the arguments it receives. * + * Following shorthands are possible for providing predicates. + * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. + * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. + * * @static * @memberOf _ * @since 4.0.0 @@ -15838,6 +15880,10 @@ * Creates a function that checks if **any** of the `predicates` return * truthy when invoked with the arguments it receives. * + * Following shorthands are possible for providing predicates. + * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. + * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. + * * @static * @memberOf _ * @since 4.0.0 @@ -15857,6 +15903,9 @@ * * func(NaN); * // => false + * + * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) + * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) */ var overSome = createOver(arraySome); diff --git a/tools/node_modules/@babel/core/node_modules/lodash/lodash.min.js b/tools/node_modules/@babel/core/node_modules/lodash/lodash.min.js new file mode 100644 index 00000000000000..a078dd9317619a --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/lodash/lodash.min.js @@ -0,0 +1,139 @@ +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +(function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u-1}function f(n,t,r){for(var e=-1,u=null==n?0:n.length;++e-1;);return r}function W(n,t){for(var r=n.length;r--&&y(t,n[r],0)>-1;);return r}function L(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;return e}function C(n){return"\\"+Gr[n]}function U(n,t){ +return null==n?Y:n[t]}function B(n){return Dr.test(n)}function T(n){return Mr.test(n)}function $(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function D(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function M(n,t){return function(r){return n(t(r))}}function F(n,t){for(var r=-1,e=n.length,u=0,i=[];++r>>1,Un=[["ary",dn],["bind",sn],["bindKey",hn],["curry",_n],["curryRight",vn],["flip",wn],["partial",gn],["partialRight",yn],["rearg",bn]],Bn="[object Arguments]",Tn="[object Array]",$n="[object AsyncFunction]",Dn="[object Boolean]",Mn="[object Date]",Fn="[object DOMException]",Nn="[object Error]",Pn="[object Function]",qn="[object GeneratorFunction]",Zn="[object Map]",Kn="[object Number]",Vn="[object Null]",Gn="[object Object]",Hn="[object Promise]",Jn="[object Proxy]",Yn="[object RegExp]",Qn="[object Set]",Xn="[object String]",nt="[object Symbol]",tt="[object Undefined]",rt="[object WeakMap]",et="[object WeakSet]",ut="[object ArrayBuffer]",it="[object DataView]",ot="[object Float32Array]",ft="[object Float64Array]",ct="[object Int8Array]",at="[object Int16Array]",lt="[object Int32Array]",st="[object Uint8Array]",ht="[object Uint8ClampedArray]",pt="[object Uint16Array]",_t="[object Uint32Array]",vt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,dt=/&(?:amp|lt|gt|quot|#39);/g,bt=/[&<>"']/g,wt=RegExp(dt.source),mt=RegExp(bt.source),xt=/<%-([\s\S]+?)%>/g,jt=/<%([\s\S]+?)%>/g,At=/<%=([\s\S]+?)%>/g,kt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ot=/^\w*$/,It=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rt=/[\\^$.*+?()[\]{}|]/g,zt=RegExp(Rt.source),Et=/^\s+|\s+$/g,St=/^\s+/,Wt=/\s+$/,Lt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ct=/\{\n\/\* \[wrapped with (.+)\] \*/,Ut=/,? & /,Bt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Tt=/\\(\\)?/g,$t=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Dt=/\w*$/,Mt=/^[-+]0x[0-9a-f]+$/i,Ft=/^0b[01]+$/i,Nt=/^\[object .+?Constructor\]$/,Pt=/^0o[0-7]+$/i,qt=/^(?:0|[1-9]\d*)$/,Zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Kt=/($^)/,Vt=/['\n\r\u2028\u2029\\]/g,Gt="\\ud800-\\udfff",Ht="\\u0300-\\u036f",Jt="\\ufe20-\\ufe2f",Yt="\\u20d0-\\u20ff",Qt=Ht+Jt+Yt,Xt="\\u2700-\\u27bf",nr="a-z\\xdf-\\xf6\\xf8-\\xff",tr="\\xac\\xb1\\xd7\\xf7",rr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",er="\\u2000-\\u206f",ur=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ir="A-Z\\xc0-\\xd6\\xd8-\\xde",or="\\ufe0e\\ufe0f",fr=tr+rr+er+ur,cr="['\u2019]",ar="["+Gt+"]",lr="["+fr+"]",sr="["+Qt+"]",hr="\\d+",pr="["+Xt+"]",_r="["+nr+"]",vr="[^"+Gt+fr+hr+Xt+nr+ir+"]",gr="\\ud83c[\\udffb-\\udfff]",yr="(?:"+sr+"|"+gr+")",dr="[^"+Gt+"]",br="(?:\\ud83c[\\udde6-\\uddff]){2}",wr="[\\ud800-\\udbff][\\udc00-\\udfff]",mr="["+ir+"]",xr="\\u200d",jr="(?:"+_r+"|"+vr+")",Ar="(?:"+mr+"|"+vr+")",kr="(?:"+cr+"(?:d|ll|m|re|s|t|ve))?",Or="(?:"+cr+"(?:D|LL|M|RE|S|T|VE))?",Ir=yr+"?",Rr="["+or+"]?",zr="(?:"+xr+"(?:"+[dr,br,wr].join("|")+")"+Rr+Ir+")*",Er="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Wr=Rr+Ir+zr,Lr="(?:"+[pr,br,wr].join("|")+")"+Wr,Cr="(?:"+[dr+sr+"?",sr,br,wr,ar].join("|")+")",Ur=RegExp(cr,"g"),Br=RegExp(sr,"g"),Tr=RegExp(gr+"(?="+gr+")|"+Cr+Wr,"g"),$r=RegExp([mr+"?"+_r+"+"+kr+"(?="+[lr,mr,"$"].join("|")+")",Ar+"+"+Or+"(?="+[lr,mr+jr,"$"].join("|")+")",mr+"?"+jr+"+"+kr,mr+"+"+Or,Sr,Er,hr,Lr].join("|"),"g"),Dr=RegExp("["+xr+Gt+Qt+or+"]"),Mr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Fr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Nr=-1,Pr={}; +Pr[ot]=Pr[ft]=Pr[ct]=Pr[at]=Pr[lt]=Pr[st]=Pr[ht]=Pr[pt]=Pr[_t]=!0,Pr[Bn]=Pr[Tn]=Pr[ut]=Pr[Dn]=Pr[it]=Pr[Mn]=Pr[Nn]=Pr[Pn]=Pr[Zn]=Pr[Kn]=Pr[Gn]=Pr[Yn]=Pr[Qn]=Pr[Xn]=Pr[rt]=!1;var qr={};qr[Bn]=qr[Tn]=qr[ut]=qr[it]=qr[Dn]=qr[Mn]=qr[ot]=qr[ft]=qr[ct]=qr[at]=qr[lt]=qr[Zn]=qr[Kn]=qr[Gn]=qr[Yn]=qr[Qn]=qr[Xn]=qr[nt]=qr[st]=qr[ht]=qr[pt]=qr[_t]=!0,qr[Nn]=qr[Pn]=qr[rt]=!1;var Zr={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a", +"\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae", +"\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g", +"\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O", +"\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w", +"\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"},Kr={"&":"&","<":"<",">":">",'"':""","'":"'"},Vr={"&":"&","<":"<",">":">",""":'"',"'":"'"},Gr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Hr=parseFloat,Jr=parseInt,Yr="object"==typeof global&&global&&global.Object===Object&&global,Qr="object"==typeof self&&self&&self.Object===Object&&self,Xr=Yr||Qr||Function("return this")(),ne="object"==typeof exports&&exports&&!exports.nodeType&&exports,te=ne&&"object"==typeof module&&module&&!module.nodeType&&module,re=te&&te.exports===ne,ee=re&&Yr.process,ue=function(){ +try{var n=te&&te.require&&te.require("util").types;return n?n:ee&&ee.binding&&ee.binding("util")}catch(n){}}(),ie=ue&&ue.isArrayBuffer,oe=ue&&ue.isDate,fe=ue&&ue.isMap,ce=ue&&ue.isRegExp,ae=ue&&ue.isSet,le=ue&&ue.isTypedArray,se=m("length"),he=x(Zr),pe=x(Kr),_e=x(Vr),ve=function p(x){function q(n){if(oc(n)&&!yh(n)&&!(n instanceof Bt)){if(n instanceof H)return n;if(yl.call(n,"__wrapped__"))return to(n)}return new H(n)}function G(){}function H(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t, +this.__index__=0,this.__values__=Y}function Bt(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Wn,this.__views__=[]}function Gt(){var n=new Bt(this.__wrapped__);return n.__actions__=Uu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Uu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Uu(this.__views__),n}function Ht(){if(this.__filtered__){var n=new Bt(this);n.__dir__=-1, +n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function Jt(){var n=this.__wrapped__.value(),t=this.__dir__,r=yh(n),e=t<0,u=r?n.length:0,i=Ai(0,u,this.__views__),o=i.start,f=i.end,c=f-o,a=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=Vl(c,this.__takeCount__);if(!r||!e&&u==c&&p==c)return du(n,this.__actions__);var _=[];n:for(;c--&&h-1}function cr(n,t){var r=this.__data__,e=Er(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this}function ar(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function Dr(n,t,e,u,i,o){var f,c=t&on,a=t&fn,l=t&cn;if(e&&(f=i?e(n,u,i,o):e(n)),f!==Y)return f;if(!ic(n))return n;var s=yh(n);if(s){if(f=Ii(n),!c)return Uu(n,f)}else{var h=Is(n),p=h==Pn||h==qn;if(bh(n))return ku(n,c);if(h==Gn||h==Bn||p&&!i){if(f=a||p?{}:Ri(n),!c)return a?$u(n,Lr(f,n)):Tu(n,Wr(f,n))}else{if(!qr[h])return i?n:{};f=zi(n,h,c)}}o||(o=new dr);var _=o.get(n);if(_)return _;o.set(n,f),jh(n)?n.forEach(function(r){f.add(Dr(r,t,e,r,n,o))}):mh(n)&&n.forEach(function(r,u){ +f.set(u,Dr(r,t,e,u,n,o))});var v=l?a?gi:vi:a?Nc:Fc,g=s?Y:v(n);return r(g||n,function(r,u){g&&(u=r,r=n[u]),zr(f,u,Dr(r,t,e,u,n,o))}),f}function Mr(n){var t=Fc(n);return function(r){return Zr(r,n,t)}}function Zr(n,t,r){var e=r.length;if(null==n)return!e;for(n=cl(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===Y&&!(u in n)||!i(o))return!1}return!0}function Kr(n,t,r){if("function"!=typeof n)throw new sl(tn);return Es(function(){n.apply(Y,r)},t)}function Vr(n,t,r,e){var u=-1,i=o,a=!0,l=n.length,s=[],h=t.length; +if(!l)return s;r&&(t=c(t,R(r))),e?(i=f,a=!1):t.length>=X&&(i=E,a=!1,t=new vr(t));n:for(;++uu?0:u+r), +e=e===Y||e>u?u:jc(e),e<0&&(e+=u),e=r>e?0:Ac(e);r0&&r(f)?t>1?te(f,t-1,r,e,u):a(u,f):e||(u[u.length]=f)}return u}function ee(n,t){return n&&ys(n,t,Fc)}function ue(n,t){return n&&ds(n,t,Fc)}function se(n,t){return i(t,function(t){return rc(n[t])})}function ve(n,t){t=ju(t,n);for(var r=0,e=t.length;null!=n&&rt}function we(n,t){return null!=n&&yl.call(n,t)}function me(n,t){return null!=n&&t in cl(n)}function xe(n,t,r){return n>=Vl(t,r)&&n=120&&p.length>=120)?new vr(a&&p):Y}p=n[0]; +var _=-1,v=l[0];n:for(;++_-1;)f!==n&&Sl.call(f,a,1),Sl.call(n,a,1);return n}function Qe(n,t){for(var r=n?t.length:0,e=r-1;r--;){ +var u=t[r];if(r==e||u!==i){var i=u;Wi(u)?Sl.call(n,u,1):vu(n,u)}}return n}function Xe(n,t){return n+Ml(Jl()*(t-n+1))}function nu(n,t,r,e){for(var u=-1,i=Kl(Dl((t-n)/(r||1)),0),o=el(i);i--;)o[e?i:++u]=n,n+=r;return o}function tu(n,t){var r="";if(!n||t<1||t>zn)return r;do t%2&&(r+=n),t=Ml(t/2),t&&(n+=n);while(t);return r}function ru(n,t){return Ss(Zi(n,t,Sa),n+"")}function eu(n){return kr(na(n))}function uu(n,t){var r=na(n);return Yi(r,$r(t,0,r.length))}function iu(n,t,r,e){if(!ic(n))return n;t=ju(t,n); +for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++uu?0:u+t),r=r>u?u:r,r<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=el(u);++e>>1,o=n[i];null!==o&&!yc(o)&&(r?o<=t:o=X){var s=t?null:js(n);if(s)return N(s);c=!1,u=E,l=new vr}else l=t?[]:a;n:for(;++e=e?n:fu(n,t,r)}function ku(n,t){if(t)return n.slice();var r=n.length,e=Il?Il(r):new n.constructor(r); +return n.copy(e),e}function Ou(n){var t=new n.constructor(n.byteLength);return new Ol(t).set(new Ol(n)),t}function Iu(n,t){return new n.constructor(t?Ou(n.buffer):n.buffer,n.byteOffset,n.byteLength)}function Ru(n){var t=new n.constructor(n.source,Dt.exec(n));return t.lastIndex=n.lastIndex,t}function zu(n){return hs?cl(hs.call(n)):{}}function Eu(n,t){return new n.constructor(t?Ou(n.buffer):n.buffer,n.byteOffset,n.length)}function Su(n,t){if(n!==t){var r=n!==Y,e=null===n,u=n===n,i=yc(n),o=t!==Y,f=null===t,c=t===t,a=yc(t); +if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n=f)return c;return c*("desc"==r[e]?-1:1)}}return n.index-t.index}function Lu(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=Kl(i-o,0),l=el(c+a),s=!e;++f1?r[u-1]:Y,o=u>2?r[2]:Y;for(i=n.length>3&&"function"==typeof i?(u--,i):Y,o&&Li(r[0],r[1],o)&&(i=u<3?Y:i,u=1),t=cl(t);++e-1?u[i?t[o]:o]:Y}}function Hu(n){return _i(function(t){var r=t.length,e=r,u=H.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if("function"!=typeof i)throw new sl(tn);if(u&&!o&&"wrapper"==yi(i))var o=new H([],!0)}for(e=o?e:r;++e1&&d.reverse(),s&&cf))return!1;var a=i.get(n),l=i.get(t);if(a&&l)return a==t&&l==n;var s=-1,p=!0,_=r&ln?new vr:Y;for(i.set(n,t),i.set(t,n);++s1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Lt,"{\n/* [wrapped with "+t+"] */\n")}function Si(n){return yh(n)||gh(n)||!!(Wl&&n&&n[Wl])}function Wi(n,t){var r=typeof n; +return t=null==t?zn:t,!!t&&("number"==r||"symbol"!=r&&qt.test(n))&&n>-1&&n%1==0&&n0){if(++t>=jn)return arguments[0]}else t=0; +return n.apply(Y,arguments)}}function Yi(n,t){var r=-1,e=n.length,u=e-1;for(t=t===Y?e:t;++r=this.__values__.length;return{done:n,value:n?Y:this.__values__[this.__index__++]}}function rf(){return this}function ef(n){for(var t,r=this;r instanceof G;){var e=to(r);e.__index__=0,e.__values__=Y,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t}function uf(){var n=this.__wrapped__;if(n instanceof Bt){var t=n;return this.__actions__.length&&(t=new Bt(this)),t=t.reverse(),t.__actions__.push({func:Qo,args:[Ro],thisArg:Y}),new H(t,this.__chain__)}return this.thru(Ro); +}function of(){return du(this.__wrapped__,this.__actions__)}function ff(n,t,r){var e=yh(n)?u:Gr;return r&&Li(n,t,r)&&(t=Y),e(n,bi(t,3))}function cf(n,t){return(yh(n)?i:ne)(n,bi(t,3))}function af(n,t){return te(vf(n,t),1)}function lf(n,t){return te(vf(n,t),Rn)}function sf(n,t,r){return r=r===Y?1:jc(r),te(vf(n,t),r)}function hf(n,t){return(yh(n)?r:vs)(n,bi(t,3))}function pf(n,t){return(yh(n)?e:gs)(n,bi(t,3))}function _f(n,t,r,e){n=Vf(n)?n:na(n),r=r&&!e?jc(r):0;var u=n.length;return r<0&&(r=Kl(u+r,0)), +gc(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&y(n,t,r)>-1}function vf(n,t){return(yh(n)?c:Fe)(n,bi(t,3))}function gf(n,t,r,e){return null==n?[]:(yh(t)||(t=null==t?[]:[t]),r=e?Y:r,yh(r)||(r=null==r?[]:[r]),Ve(n,t,r))}function yf(n,t,r){var e=yh(n)?l:j,u=arguments.length<3;return e(n,bi(t,4),r,u,vs)}function df(n,t,r){var e=yh(n)?s:j,u=arguments.length<3;return e(n,bi(t,4),r,u,gs)}function bf(n,t){return(yh(n)?i:ne)(n,Lf(bi(t,3)))}function wf(n){return(yh(n)?kr:eu)(n)}function mf(n,t,r){return t=(r?Li(n,t,r):t===Y)?1:jc(t), +(yh(n)?Or:uu)(n,t)}function xf(n){return(yh(n)?Ir:ou)(n)}function jf(n){if(null==n)return 0;if(Vf(n))return gc(n)?K(n):n.length;var t=Is(n);return t==Zn||t==Qn?n.size:$e(n).length}function Af(n,t,r){var e=yh(n)?h:cu;return r&&Li(n,t,r)&&(t=Y),e(n,bi(t,3))}function kf(n,t){if("function"!=typeof t)throw new sl(tn);return n=jc(n),function(){if(--n<1)return t.apply(this,arguments)}}function Of(n,t,r){return t=r?Y:t,t=n&&null==t?n.length:t,fi(n,dn,Y,Y,Y,Y,t)}function If(n,t){var r;if("function"!=typeof t)throw new sl(tn); +return n=jc(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=Y),r}}function Rf(n,t,r){t=r?Y:t;var e=fi(n,_n,Y,Y,Y,Y,Y,t);return e.placeholder=Rf.placeholder,e}function zf(n,t,r){t=r?Y:t;var e=fi(n,vn,Y,Y,Y,Y,Y,t);return e.placeholder=zf.placeholder,e}function Ef(n,t,r){function e(t){var r=h,e=p;return h=p=Y,d=t,v=n.apply(e,r)}function u(n){return d=n,g=Es(f,t),b?e(n):v}function i(n){var r=n-y,e=n-d,u=t-r;return w?Vl(u,_-e):u}function o(n){var r=n-y,e=n-d;return y===Y||r>=t||r<0||w&&e>=_; +}function f(){var n=ih();return o(n)?c(n):(g=Es(f,i(n)),Y)}function c(n){return g=Y,m&&h?e(n):(h=p=Y,v)}function a(){g!==Y&&xs(g),d=0,h=y=p=g=Y}function l(){return g===Y?v:c(ih())}function s(){var n=ih(),r=o(n);if(h=arguments,p=this,y=n,r){if(g===Y)return u(y);if(w)return xs(g),g=Es(f,t),e(y)}return g===Y&&(g=Es(f,t)),v}var h,p,_,v,g,y,d=0,b=!1,w=!1,m=!0;if("function"!=typeof n)throw new sl(tn);return t=kc(t)||0,ic(r)&&(b=!!r.leading,w="maxWait"in r,_=w?Kl(kc(r.maxWait)||0,t):_,m="trailing"in r?!!r.trailing:m), +s.cancel=a,s.flush=l,s}function Sf(n){return fi(n,wn)}function Wf(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new sl(tn);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Wf.Cache||ar),r}function Lf(n){if("function"!=typeof n)throw new sl(tn);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2: +return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Cf(n){return If(2,n)}function Uf(n,t){if("function"!=typeof n)throw new sl(tn);return t=t===Y?t:jc(t),ru(n,t)}function Bf(t,r){if("function"!=typeof t)throw new sl(tn);return r=null==r?0:Kl(jc(r),0),ru(function(e){var u=e[r],i=Au(e,0,r);return u&&a(i,u),n(t,this,i)})}function Tf(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new sl(tn);return ic(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u), +Ef(n,t,{leading:e,maxWait:t,trailing:u})}function $f(n){return Of(n,1)}function Df(n,t){return sh(xu(t),n)}function Mf(){if(!arguments.length)return[];var n=arguments[0];return yh(n)?n:[n]}function Ff(n){return Dr(n,cn)}function Nf(n,t){return t="function"==typeof t?t:Y,Dr(n,cn,t)}function Pf(n){return Dr(n,on|cn)}function qf(n,t){return t="function"==typeof t?t:Y,Dr(n,on|cn,t)}function Zf(n,t){return null==t||Zr(n,t,Fc(t))}function Kf(n,t){return n===t||n!==n&&t!==t}function Vf(n){return null!=n&&uc(n.length)&&!rc(n); +}function Gf(n){return oc(n)&&Vf(n)}function Hf(n){return n===!0||n===!1||oc(n)&&de(n)==Dn}function Jf(n){return oc(n)&&1===n.nodeType&&!_c(n)}function Yf(n){if(null==n)return!0;if(Vf(n)&&(yh(n)||"string"==typeof n||"function"==typeof n.splice||bh(n)||Ah(n)||gh(n)))return!n.length;var t=Is(n);if(t==Zn||t==Qn)return!n.size;if($i(n))return!$e(n).length;for(var r in n)if(yl.call(n,r))return!1;return!0}function Qf(n,t){return ze(n,t)}function Xf(n,t,r){r="function"==typeof r?r:Y;var e=r?r(n,t):Y;return e===Y?ze(n,t,Y,r):!!e; +}function nc(n){if(!oc(n))return!1;var t=de(n);return t==Nn||t==Fn||"string"==typeof n.message&&"string"==typeof n.name&&!_c(n)}function tc(n){return"number"==typeof n&&Pl(n)}function rc(n){if(!ic(n))return!1;var t=de(n);return t==Pn||t==qn||t==$n||t==Jn}function ec(n){return"number"==typeof n&&n==jc(n)}function uc(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=zn}function ic(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function oc(n){return null!=n&&"object"==typeof n}function fc(n,t){ +return n===t||We(n,t,mi(t))}function cc(n,t,r){return r="function"==typeof r?r:Y,We(n,t,mi(t),r)}function ac(n){return pc(n)&&n!=+n}function lc(n){if(Rs(n))throw new il(nn);return Le(n)}function sc(n){return null===n}function hc(n){return null==n}function pc(n){return"number"==typeof n||oc(n)&&de(n)==Kn}function _c(n){if(!oc(n)||de(n)!=Gn)return!1;var t=Rl(n);if(null===t)return!0;var r=yl.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&gl.call(r)==ml}function vc(n){ +return ec(n)&&n>=-zn&&n<=zn}function gc(n){return"string"==typeof n||!yh(n)&&oc(n)&&de(n)==Xn}function yc(n){return"symbol"==typeof n||oc(n)&&de(n)==nt}function dc(n){return n===Y}function bc(n){return oc(n)&&Is(n)==rt}function wc(n){return oc(n)&&de(n)==et}function mc(n){if(!n)return[];if(Vf(n))return gc(n)?V(n):Uu(n);if(Ll&&n[Ll])return $(n[Ll]());var t=Is(n);return(t==Zn?D:t==Qn?N:na)(n)}function xc(n){if(!n)return 0===n?n:0;if(n=kc(n),n===Rn||n===-Rn){return(n<0?-1:1)*En}return n===n?n:0}function jc(n){ +var t=xc(n),r=t%1;return t===t?r?t-r:t:0}function Ac(n){return n?$r(jc(n),0,Wn):0}function kc(n){if("number"==typeof n)return n;if(yc(n))return Sn;if(ic(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=ic(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=n.replace(Et,"");var r=Ft.test(n);return r||Pt.test(n)?Jr(n.slice(2),r?2:8):Mt.test(n)?Sn:+n}function Oc(n){return Bu(n,Nc(n))}function Ic(n){return n?$r(jc(n),-zn,zn):0===n?n:0}function Rc(n){return null==n?"":pu(n)}function zc(n,t){var r=_s(n); +return null==t?r:Wr(r,t)}function Ec(n,t){return v(n,bi(t,3),ee)}function Sc(n,t){return v(n,bi(t,3),ue)}function Wc(n,t){return null==n?n:ys(n,bi(t,3),Nc)}function Lc(n,t){return null==n?n:ds(n,bi(t,3),Nc)}function Cc(n,t){return n&&ee(n,bi(t,3))}function Uc(n,t){return n&&ue(n,bi(t,3))}function Bc(n){return null==n?[]:se(n,Fc(n))}function Tc(n){return null==n?[]:se(n,Nc(n))}function $c(n,t,r){var e=null==n?Y:ve(n,t);return e===Y?r:e}function Dc(n,t){return null!=n&&Oi(n,t,we)}function Mc(n,t){return null!=n&&Oi(n,t,me); +}function Fc(n){return Vf(n)?Ar(n):$e(n)}function Nc(n){return Vf(n)?Ar(n,!0):De(n)}function Pc(n,t){var r={};return t=bi(t,3),ee(n,function(n,e,u){Cr(r,t(n,e,u),n)}),r}function qc(n,t){var r={};return t=bi(t,3),ee(n,function(n,e,u){Cr(r,e,t(n,e,u))}),r}function Zc(n,t){return Kc(n,Lf(bi(t)))}function Kc(n,t){if(null==n)return{};var r=c(gi(n),function(n){return[n]});return t=bi(t),He(n,r,function(n,r){return t(n,r[0])})}function Vc(n,t,r){t=ju(t,n);var e=-1,u=t.length;for(u||(u=1,n=Y);++et){ +var e=n;n=t,t=e}if(r||n%1||t%1){var u=Jl();return Vl(n+u*(t-n+Hr("1e-"+((u+"").length-1))),t)}return Xe(n,t)}function ia(n){return Jh(Rc(n).toLowerCase())}function oa(n){return n=Rc(n),n&&n.replace(Zt,he).replace(Br,"")}function fa(n,t,r){n=Rc(n),t=pu(t);var e=n.length;r=r===Y?e:$r(jc(r),0,e);var u=r;return r-=t.length,r>=0&&n.slice(r,u)==t}function ca(n){return n=Rc(n),n&&mt.test(n)?n.replace(bt,pe):n}function aa(n){return n=Rc(n),n&&zt.test(n)?n.replace(Rt,"\\$&"):n}function la(n,t,r){n=Rc(n),t=jc(t); +var e=t?K(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return ni(Ml(u),r)+n+ni(Dl(u),r)}function sa(n,t,r){n=Rc(n),t=jc(t);var e=t?K(n):0;return t&&e>>0)?(n=Rc(n),n&&("string"==typeof t||null!=t&&!xh(t))&&(t=pu(t),!t&&B(n))?Au(V(n),0,r):n.split(t,r)):[]}function ya(n,t,r){return n=Rc(n),r=null==r?0:$r(jc(r),0,n.length),t=pu(t),n.slice(r,r+t.length)==t}function da(n,t,r){var e=q.templateSettings;r&&Li(n,t,r)&&(t=Y),n=Rc(n),t=zh({},t,e,ci);var u,i,o=zh({},t.imports,e.imports,ci),f=Fc(o),c=z(o,f),a=0,l=t.interpolate||Kt,s="__p += '",h=al((t.escape||Kt).source+"|"+l.source+"|"+(l===At?$t:Kt).source+"|"+(t.evaluate||Kt).source+"|$","g"),p="//# sourceURL="+(yl.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Nr+"]")+"\n"; +n.replace(h,function(t,r,e,o,f,c){return e||(e=o),s+=n.slice(a,c).replace(Vt,C),r&&(u=!0,s+="' +\n__e("+r+") +\n'"),f&&(i=!0,s+="';\n"+f+";\n__p += '"),e&&(s+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),a=c+t.length,t}),s+="';\n";var _=yl.call(t,"variable")&&t.variable;_||(s="with (obj) {\n"+s+"\n}\n"),s=(i?s.replace(vt,""):s).replace(gt,"$1").replace(yt,"$1;"),s="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}"; +var v=Yh(function(){return ol(f,p+"return "+s).apply(Y,c)});if(v.source=s,nc(v))throw v;return v}function ba(n){return Rc(n).toLowerCase()}function wa(n){return Rc(n).toUpperCase()}function ma(n,t,r){if(n=Rc(n),n&&(r||t===Y))return n.replace(Et,"");if(!n||!(t=pu(t)))return n;var e=V(n),u=V(t);return Au(e,S(e,u),W(e,u)+1).join("")}function xa(n,t,r){if(n=Rc(n),n&&(r||t===Y))return n.replace(Wt,"");if(!n||!(t=pu(t)))return n;var e=V(n);return Au(e,0,W(e,V(t))+1).join("")}function ja(n,t,r){if(n=Rc(n), +n&&(r||t===Y))return n.replace(St,"");if(!n||!(t=pu(t)))return n;var e=V(n);return Au(e,S(e,V(t))).join("")}function Aa(n,t){var r=mn,e=xn;if(ic(t)){var u="separator"in t?t.separator:u;r="length"in t?jc(t.length):r,e="omission"in t?pu(t.omission):e}n=Rc(n);var i=n.length;if(B(n)){var o=V(n);i=o.length}if(r>=i)return n;var f=r-K(e);if(f<1)return e;var c=o?Au(o,0,f).join(""):n.slice(0,f);if(u===Y)return c+e;if(o&&(f+=c.length-f),xh(u)){if(n.slice(f).search(u)){var a,l=c;for(u.global||(u=al(u.source,Rc(Dt.exec(u))+"g")), +u.lastIndex=0;a=u.exec(l);)var s=a.index;c=c.slice(0,s===Y?f:s)}}else if(n.indexOf(pu(u),f)!=f){var h=c.lastIndexOf(u);h>-1&&(c=c.slice(0,h))}return c+e}function ka(n){return n=Rc(n),n&&wt.test(n)?n.replace(dt,_e):n}function Oa(n,t,r){return n=Rc(n),t=r?Y:t,t===Y?T(n)?J(n):_(n):n.match(t)||[]}function Ia(t){var r=null==t?0:t.length,e=bi();return t=r?c(t,function(n){if("function"!=typeof n[1])throw new sl(tn);return[e(n[0]),n[1]]}):[],ru(function(e){for(var u=-1;++uzn)return[];var r=Wn,e=Vl(n,Wn);t=bi(t),n-=Wn;for(var u=O(e,t);++r1?n[t-1]:Y;return r="function"==typeof r?(n.pop(), +r):Y,Vo(n,r)}),Js=_i(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return Tr(t,n)};return!(t>1||this.__actions__.length)&&e instanceof Bt&&Wi(r)?(e=e.slice(r,+r+(t?1:0)),e.__actions__.push({func:Qo,args:[u],thisArg:Y}),new H(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(Y),n})):this.thru(u)}),Ys=Du(function(n,t,r){yl.call(n,r)?++n[r]:Cr(n,r,1)}),Qs=Gu(lo),Xs=Gu(so),nh=Du(function(n,t,r){yl.call(n,r)?n[r].push(t):Cr(n,r,[t])}),th=ru(function(t,r,e){var u=-1,i="function"==typeof r,o=Vf(t)?el(t.length):[]; +return vs(t,function(t){o[++u]=i?n(r,t,e):ke(t,r,e)}),o}),rh=Du(function(n,t,r){Cr(n,r,t)}),eh=Du(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),uh=ru(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Li(n,t[0],t[1])?t=[]:r>2&&Li(t[0],t[1],t[2])&&(t=[t[0]]),Ve(n,te(t,1),[])}),ih=Tl||function(){return Xr.Date.now()},oh=ru(function(n,t,r){var e=sn;if(r.length){var u=F(r,di(oh));e|=gn}return fi(n,e,t,r,u)}),fh=ru(function(n,t,r){var e=sn|hn;if(r.length){var u=F(r,di(fh));e|=gn; +}return fi(t,e,n,r,u)}),ch=ru(function(n,t){return Kr(n,1,t)}),ah=ru(function(n,t,r){return Kr(n,kc(t)||0,r)});Wf.Cache=ar;var lh=ms(function(t,r){r=1==r.length&&yh(r[0])?c(r[0],R(bi())):c(te(r,1),R(bi()));var e=r.length;return ru(function(u){for(var i=-1,o=Vl(u.length,e);++i=t}),gh=Oe(function(){return arguments}())?Oe:function(n){return oc(n)&&yl.call(n,"callee")&&!El.call(n,"callee")},yh=el.isArray,dh=ie?R(ie):Ie,bh=Nl||Na,wh=oe?R(oe):Re,mh=fe?R(fe):Se,xh=ce?R(ce):Ce,jh=ae?R(ae):Ue,Ah=le?R(le):Be,kh=ei(Me),Oh=ei(function(n,t){return n<=t}),Ih=Mu(function(n,t){if($i(t)||Vf(t))return Bu(t,Fc(t),n),Y;for(var r in t)yl.call(t,r)&&zr(n,r,t[r])}),Rh=Mu(function(n,t){Bu(t,Nc(t),n)}),zh=Mu(function(n,t,r,e){Bu(t,Nc(t),n,e)}),Eh=Mu(function(n,t,r,e){Bu(t,Fc(t),n,e); +}),Sh=_i(Tr),Wh=ru(function(n,t){n=cl(n);var r=-1,e=t.length,u=e>2?t[2]:Y;for(u&&Li(t[0],t[1],u)&&(e=1);++r1),t}),Bu(n,gi(n),r),e&&(r=Dr(r,on|fn|cn,li));for(var u=t.length;u--;)vu(r,t[u]);return r}),Mh=_i(function(n,t){return null==n?{}:Ge(n,t)}),Fh=oi(Fc),Nh=oi(Nc),Ph=Zu(function(n,t,r){return t=t.toLowerCase(),n+(r?ia(t):t)}),qh=Zu(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Zh=Zu(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Kh=qu("toLowerCase"),Vh=Zu(function(n,t,r){ +return n+(r?"_":"")+t.toLowerCase()}),Gh=Zu(function(n,t,r){return n+(r?" ":"")+Jh(t)}),Hh=Zu(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Jh=qu("toUpperCase"),Yh=ru(function(t,r){try{return n(t,Y,r)}catch(n){return nc(n)?n:new il(n)}}),Qh=_i(function(n,t){return r(t,function(t){t=Qi(t),Cr(n,t,oh(n[t],n))}),n}),Xh=Hu(),np=Hu(!0),tp=ru(function(n,t){return function(r){return ke(r,n,t)}}),rp=ru(function(n,t){return function(r){return ke(n,r,t)}}),ep=Xu(c),up=Xu(u),ip=Xu(h),op=ri(),fp=ri(!0),cp=Qu(function(n,t){ +return n+t},0),ap=ii("ceil"),lp=Qu(function(n,t){return n/t},1),sp=ii("floor"),hp=Qu(function(n,t){return n*t},1),pp=ii("round"),_p=Qu(function(n,t){return n-t},0);return q.after=kf,q.ary=Of,q.assign=Ih,q.assignIn=Rh,q.assignInWith=zh,q.assignWith=Eh,q.at=Sh,q.before=If,q.bind=oh,q.bindAll=Qh,q.bindKey=fh,q.castArray=Mf,q.chain=Jo,q.chunk=ro,q.compact=eo,q.concat=uo,q.cond=Ia,q.conforms=Ra,q.constant=za,q.countBy=Ys,q.create=zc,q.curry=Rf,q.curryRight=zf,q.debounce=Ef,q.defaults=Wh,q.defaultsDeep=Lh, +q.defer=ch,q.delay=ah,q.difference=Ls,q.differenceBy=Cs,q.differenceWith=Us,q.drop=io,q.dropRight=oo,q.dropRightWhile=fo,q.dropWhile=co,q.fill=ao,q.filter=cf,q.flatMap=af,q.flatMapDeep=lf,q.flatMapDepth=sf,q.flatten=ho,q.flattenDeep=po,q.flattenDepth=_o,q.flip=Sf,q.flow=Xh,q.flowRight=np,q.fromPairs=vo,q.functions=Bc,q.functionsIn=Tc,q.groupBy=nh,q.initial=bo,q.intersection=Bs,q.intersectionBy=Ts,q.intersectionWith=$s,q.invert=Ch,q.invertBy=Uh,q.invokeMap=th,q.iteratee=Wa,q.keyBy=rh,q.keys=Fc,q.keysIn=Nc, +q.map=vf,q.mapKeys=Pc,q.mapValues=qc,q.matches=La,q.matchesProperty=Ca,q.memoize=Wf,q.merge=Th,q.mergeWith=$h,q.method=tp,q.methodOf=rp,q.mixin=Ua,q.negate=Lf,q.nthArg=$a,q.omit=Dh,q.omitBy=Zc,q.once=Cf,q.orderBy=gf,q.over=ep,q.overArgs=lh,q.overEvery=up,q.overSome=ip,q.partial=sh,q.partialRight=hh,q.partition=eh,q.pick=Mh,q.pickBy=Kc,q.property=Da,q.propertyOf=Ma,q.pull=Ds,q.pullAll=Ao,q.pullAllBy=ko,q.pullAllWith=Oo,q.pullAt=Ms,q.range=op,q.rangeRight=fp,q.rearg=ph,q.reject=bf,q.remove=Io,q.rest=Uf, +q.reverse=Ro,q.sampleSize=mf,q.set=Gc,q.setWith=Hc,q.shuffle=xf,q.slice=zo,q.sortBy=uh,q.sortedUniq=Bo,q.sortedUniqBy=To,q.split=ga,q.spread=Bf,q.tail=$o,q.take=Do,q.takeRight=Mo,q.takeRightWhile=Fo,q.takeWhile=No,q.tap=Yo,q.throttle=Tf,q.thru=Qo,q.toArray=mc,q.toPairs=Fh,q.toPairsIn=Nh,q.toPath=Va,q.toPlainObject=Oc,q.transform=Jc,q.unary=$f,q.union=Fs,q.unionBy=Ns,q.unionWith=Ps,q.uniq=Po,q.uniqBy=qo,q.uniqWith=Zo,q.unset=Yc,q.unzip=Ko,q.unzipWith=Vo,q.update=Qc,q.updateWith=Xc,q.values=na,q.valuesIn=ta, +q.without=qs,q.words=Oa,q.wrap=Df,q.xor=Zs,q.xorBy=Ks,q.xorWith=Vs,q.zip=Gs,q.zipObject=Go,q.zipObjectDeep=Ho,q.zipWith=Hs,q.entries=Fh,q.entriesIn=Nh,q.extend=Rh,q.extendWith=zh,Ua(q,q),q.add=cp,q.attempt=Yh,q.camelCase=Ph,q.capitalize=ia,q.ceil=ap,q.clamp=ra,q.clone=Ff,q.cloneDeep=Pf,q.cloneDeepWith=qf,q.cloneWith=Nf,q.conformsTo=Zf,q.deburr=oa,q.defaultTo=Ea,q.divide=lp,q.endsWith=fa,q.eq=Kf,q.escape=ca,q.escapeRegExp=aa,q.every=ff,q.find=Qs,q.findIndex=lo,q.findKey=Ec,q.findLast=Xs,q.findLastIndex=so, +q.findLastKey=Sc,q.floor=sp,q.forEach=hf,q.forEachRight=pf,q.forIn=Wc,q.forInRight=Lc,q.forOwn=Cc,q.forOwnRight=Uc,q.get=$c,q.gt=_h,q.gte=vh,q.has=Dc,q.hasIn=Mc,q.head=go,q.identity=Sa,q.includes=_f,q.indexOf=yo,q.inRange=ea,q.invoke=Bh,q.isArguments=gh,q.isArray=yh,q.isArrayBuffer=dh,q.isArrayLike=Vf,q.isArrayLikeObject=Gf,q.isBoolean=Hf,q.isBuffer=bh,q.isDate=wh,q.isElement=Jf,q.isEmpty=Yf,q.isEqual=Qf,q.isEqualWith=Xf,q.isError=nc,q.isFinite=tc,q.isFunction=rc,q.isInteger=ec,q.isLength=uc,q.isMap=mh, +q.isMatch=fc,q.isMatchWith=cc,q.isNaN=ac,q.isNative=lc,q.isNil=hc,q.isNull=sc,q.isNumber=pc,q.isObject=ic,q.isObjectLike=oc,q.isPlainObject=_c,q.isRegExp=xh,q.isSafeInteger=vc,q.isSet=jh,q.isString=gc,q.isSymbol=yc,q.isTypedArray=Ah,q.isUndefined=dc,q.isWeakMap=bc,q.isWeakSet=wc,q.join=wo,q.kebabCase=qh,q.last=mo,q.lastIndexOf=xo,q.lowerCase=Zh,q.lowerFirst=Kh,q.lt=kh,q.lte=Oh,q.max=Ha,q.maxBy=Ja,q.mean=Ya,q.meanBy=Qa,q.min=Xa,q.minBy=nl,q.stubArray=Fa,q.stubFalse=Na,q.stubObject=Pa,q.stubString=qa, +q.stubTrue=Za,q.multiply=hp,q.nth=jo,q.noConflict=Ba,q.noop=Ta,q.now=ih,q.pad=la,q.padEnd=sa,q.padStart=ha,q.parseInt=pa,q.random=ua,q.reduce=yf,q.reduceRight=df,q.repeat=_a,q.replace=va,q.result=Vc,q.round=pp,q.runInContext=p,q.sample=wf,q.size=jf,q.snakeCase=Vh,q.some=Af,q.sortedIndex=Eo,q.sortedIndexBy=So,q.sortedIndexOf=Wo,q.sortedLastIndex=Lo,q.sortedLastIndexBy=Co,q.sortedLastIndexOf=Uo,q.startCase=Gh,q.startsWith=ya,q.subtract=_p,q.sum=tl,q.sumBy=rl,q.template=da,q.times=Ka,q.toFinite=xc,q.toInteger=jc, +q.toLength=Ac,q.toLower=ba,q.toNumber=kc,q.toSafeInteger=Ic,q.toString=Rc,q.toUpper=wa,q.trim=ma,q.trimEnd=xa,q.trimStart=ja,q.truncate=Aa,q.unescape=ka,q.uniqueId=Ga,q.upperCase=Hh,q.upperFirst=Jh,q.each=hf,q.eachRight=pf,q.first=go,Ua(q,function(){var n={};return ee(q,function(t,r){yl.call(q.prototype,r)||(n[r]=t)}),n}(),{chain:!1}),q.VERSION=Q,r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){q[n].placeholder=q}),r(["drop","take"],function(n,t){Bt.prototype[n]=function(r){ +r=r===Y?1:Kl(jc(r),0);var e=this.__filtered__&&!t?new Bt(this):this.clone();return e.__filtered__?e.__takeCount__=Vl(r,e.__takeCount__):e.__views__.push({size:Vl(r,Wn),type:n+(e.__dir__<0?"Right":"")}),e},Bt.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=r==kn||r==In;Bt.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:bi(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){ +var r="take"+(t?"Right":"");Bt.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Bt.prototype[n]=function(){return this.__filtered__?new Bt(this):this[r](1)}}),Bt.prototype.compact=function(){return this.filter(Sa)},Bt.prototype.find=function(n){return this.filter(n).head()},Bt.prototype.findLast=function(n){return this.reverse().find(n)},Bt.prototype.invokeMap=ru(function(n,t){return"function"==typeof n?new Bt(this):this.map(function(r){ +return ke(r,n,t)})}),Bt.prototype.reject=function(n){return this.filter(Lf(bi(n)))},Bt.prototype.slice=function(n,t){n=jc(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Bt(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==Y&&(t=jc(t),r=t<0?r.dropRight(-t):r.take(t-n)),r)},Bt.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Bt.prototype.toArray=function(){return this.take(Wn)},ee(Bt.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=q[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t); +u&&(q.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Bt,c=o[0],l=f||yh(t),s=function(n){var t=u.apply(q,a([n],o));return e&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(f=l=!1);var h=this.__chain__,p=!!this.__actions__.length,_=i&&!h,v=f&&!p;if(!i&&l){t=v?t:new Bt(this);var g=n.apply(t,o);return g.__actions__.push({func:Qo,args:[s],thisArg:Y}),new H(g,h)}return _&&v?n.apply(this,o):(g=this.thru(s),_?e?g.value()[0]:g.value():g)})}),r(["pop","push","shift","sort","splice","unshift"],function(n){ +var t=hl[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);q.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(yh(u)?u:[],n)}return this[r](function(r){return t.apply(yh(r)?r:[],n)})}}),ee(Bt.prototype,function(n,t){var r=q[t];if(r){var e=r.name+"";yl.call(is,e)||(is[e]=[]),is[e].push({name:t,func:r})}}),is[Ju(Y,hn).name]=[{name:"wrapper",func:Y}],Bt.prototype.clone=Gt,Bt.prototype.reverse=Ht,Bt.prototype.value=Jt,q.prototype.at=Js, +q.prototype.chain=Xo,q.prototype.commit=nf,q.prototype.next=tf,q.prototype.plant=ef,q.prototype.reverse=uf,q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=of,q.prototype.first=q.prototype.head,Ll&&(q.prototype[Ll]=rf),q},ge=ve();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Xr._=ge,define(function(){return ge})):te?((te.exports=ge)._=ge,ne._=ge):Xr._=ge}).call(this); \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/lowerCase.js b/tools/node_modules/@babel/core/node_modules/lodash/lowerCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/lowerCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/lowerCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/lowerFirst.js b/tools/node_modules/@babel/core/node_modules/lodash/lowerFirst.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/lowerFirst.js rename to tools/node_modules/@babel/core/node_modules/lodash/lowerFirst.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/lt.js b/tools/node_modules/@babel/core/node_modules/lodash/lt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/lt.js rename to tools/node_modules/@babel/core/node_modules/lodash/lt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/lte.js b/tools/node_modules/@babel/core/node_modules/lodash/lte.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/lte.js rename to tools/node_modules/@babel/core/node_modules/lodash/lte.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/map.js b/tools/node_modules/@babel/core/node_modules/lodash/map.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/map.js rename to tools/node_modules/@babel/core/node_modules/lodash/map.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/mapKeys.js b/tools/node_modules/@babel/core/node_modules/lodash/mapKeys.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/mapKeys.js rename to tools/node_modules/@babel/core/node_modules/lodash/mapKeys.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/mapValues.js b/tools/node_modules/@babel/core/node_modules/lodash/mapValues.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/mapValues.js rename to tools/node_modules/@babel/core/node_modules/lodash/mapValues.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/matches.js b/tools/node_modules/@babel/core/node_modules/lodash/matches.js similarity index 79% rename from tools/node_modules/babel-eslint/node_modules/lodash/matches.js rename to tools/node_modules/@babel/core/node_modules/lodash/matches.js index 11145db37f4fa1..e10b35198b8517 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/matches.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/matches.js @@ -16,6 +16,9 @@ var CLONE_DEEP_FLAG = 1; * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * + * **Note:** Multiple values can be checked by combining several matchers + * using `_.overSome` + * * @static * @memberOf _ * @since 3.0.0 @@ -31,6 +34,10 @@ var CLONE_DEEP_FLAG = 1; * * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); * // => [{ 'a': 4, 'b': 5, 'c': 6 }] + * + * // Checking for several possible values + * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); + * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] */ function matches(source) { return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/matchesProperty.js b/tools/node_modules/@babel/core/node_modules/lodash/matchesProperty.js similarity index 79% rename from tools/node_modules/babel-eslint/node_modules/lodash/matchesProperty.js rename to tools/node_modules/@babel/core/node_modules/lodash/matchesProperty.js index cc062ac99378e9..e6f1a882d610a8 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/matchesProperty.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/matchesProperty.js @@ -13,6 +13,9 @@ var CLONE_DEEP_FLAG = 1; * `srcValue` values against any array or object value, respectively. See * `_.isEqual` for a list of supported value comparisons. * + * **Note:** Multiple values can be checked by combining several matchers + * using `_.overSome` + * * @static * @memberOf _ * @since 3.2.0 @@ -29,6 +32,10 @@ var CLONE_DEEP_FLAG = 1; * * _.find(objects, _.matchesProperty('a', 4)); * // => { 'a': 4, 'b': 5, 'c': 6 } + * + * // Checking for several possible values + * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); + * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] */ function matchesProperty(path, srcValue) { return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/math.js b/tools/node_modules/@babel/core/node_modules/lodash/math.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/math.js rename to tools/node_modules/@babel/core/node_modules/lodash/math.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/max.js b/tools/node_modules/@babel/core/node_modules/lodash/max.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/max.js rename to tools/node_modules/@babel/core/node_modules/lodash/max.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/maxBy.js b/tools/node_modules/@babel/core/node_modules/lodash/maxBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/maxBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/maxBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/mean.js b/tools/node_modules/@babel/core/node_modules/lodash/mean.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/mean.js rename to tools/node_modules/@babel/core/node_modules/lodash/mean.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/meanBy.js b/tools/node_modules/@babel/core/node_modules/lodash/meanBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/meanBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/meanBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/memoize.js b/tools/node_modules/@babel/core/node_modules/lodash/memoize.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/memoize.js rename to tools/node_modules/@babel/core/node_modules/lodash/memoize.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/merge.js b/tools/node_modules/@babel/core/node_modules/lodash/merge.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/merge.js rename to tools/node_modules/@babel/core/node_modules/lodash/merge.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/mergeWith.js b/tools/node_modules/@babel/core/node_modules/lodash/mergeWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/mergeWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/mergeWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/method.js b/tools/node_modules/@babel/core/node_modules/lodash/method.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/method.js rename to tools/node_modules/@babel/core/node_modules/lodash/method.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/methodOf.js b/tools/node_modules/@babel/core/node_modules/lodash/methodOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/methodOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/methodOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/min.js b/tools/node_modules/@babel/core/node_modules/lodash/min.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/min.js rename to tools/node_modules/@babel/core/node_modules/lodash/min.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/minBy.js b/tools/node_modules/@babel/core/node_modules/lodash/minBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/minBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/minBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/mixin.js b/tools/node_modules/@babel/core/node_modules/lodash/mixin.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/mixin.js rename to tools/node_modules/@babel/core/node_modules/lodash/mixin.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/multiply.js b/tools/node_modules/@babel/core/node_modules/lodash/multiply.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/multiply.js rename to tools/node_modules/@babel/core/node_modules/lodash/multiply.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/negate.js b/tools/node_modules/@babel/core/node_modules/lodash/negate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/negate.js rename to tools/node_modules/@babel/core/node_modules/lodash/negate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/next.js b/tools/node_modules/@babel/core/node_modules/lodash/next.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/next.js rename to tools/node_modules/@babel/core/node_modules/lodash/next.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/noop.js b/tools/node_modules/@babel/core/node_modules/lodash/noop.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/noop.js rename to tools/node_modules/@babel/core/node_modules/lodash/noop.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/now.js b/tools/node_modules/@babel/core/node_modules/lodash/now.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/now.js rename to tools/node_modules/@babel/core/node_modules/lodash/now.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/nth.js b/tools/node_modules/@babel/core/node_modules/lodash/nth.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/nth.js rename to tools/node_modules/@babel/core/node_modules/lodash/nth.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/nthArg.js b/tools/node_modules/@babel/core/node_modules/lodash/nthArg.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/nthArg.js rename to tools/node_modules/@babel/core/node_modules/lodash/nthArg.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/number.js b/tools/node_modules/@babel/core/node_modules/lodash/number.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/number.js rename to tools/node_modules/@babel/core/node_modules/lodash/number.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/object.js b/tools/node_modules/@babel/core/node_modules/lodash/object.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/object.js rename to tools/node_modules/@babel/core/node_modules/lodash/object.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/omit.js b/tools/node_modules/@babel/core/node_modules/lodash/omit.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/omit.js rename to tools/node_modules/@babel/core/node_modules/lodash/omit.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/omitBy.js b/tools/node_modules/@babel/core/node_modules/lodash/omitBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/omitBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/omitBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/once.js b/tools/node_modules/@babel/core/node_modules/lodash/once.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/once.js rename to tools/node_modules/@babel/core/node_modules/lodash/once.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/orderBy.js b/tools/node_modules/@babel/core/node_modules/lodash/orderBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/orderBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/orderBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/over.js b/tools/node_modules/@babel/core/node_modules/lodash/over.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/over.js rename to tools/node_modules/@babel/core/node_modules/lodash/over.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/overArgs.js b/tools/node_modules/@babel/core/node_modules/lodash/overArgs.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/overArgs.js rename to tools/node_modules/@babel/core/node_modules/lodash/overArgs.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/overEvery.js b/tools/node_modules/@babel/core/node_modules/lodash/overEvery.js similarity index 71% rename from tools/node_modules/babel-eslint/node_modules/lodash/overEvery.js rename to tools/node_modules/@babel/core/node_modules/lodash/overEvery.js index c115d15384c866..fb19d13ed987e1 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/overEvery.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/overEvery.js @@ -5,6 +5,10 @@ var arrayEvery = require('./_arrayEvery'), * Creates a function that checks if **all** of the `predicates` return * truthy when invoked with the arguments it receives. * + * Following shorthands are possible for providing predicates. + * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. + * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. + * * @static * @memberOf _ * @since 4.0.0 diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/overSome.js b/tools/node_modules/@babel/core/node_modules/lodash/overSome.js similarity index 62% rename from tools/node_modules/babel-eslint/node_modules/lodash/overSome.js rename to tools/node_modules/@babel/core/node_modules/lodash/overSome.js index f902907a954114..414ab66b925d1a 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/overSome.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/overSome.js @@ -5,6 +5,10 @@ var arraySome = require('./_arraySome'), * Creates a function that checks if **any** of the `predicates` return * truthy when invoked with the arguments it receives. * + * Following shorthands are possible for providing predicates. + * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. + * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. + * * @static * @memberOf _ * @since 4.0.0 @@ -24,6 +28,9 @@ var arraySome = require('./_arraySome'), * * func(NaN); * // => false + * + * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) + * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) */ var overSome = createOver(arraySome); diff --git a/tools/node_modules/@babel/core/node_modules/lodash/package.json b/tools/node_modules/@babel/core/node_modules/lodash/package.json new file mode 100644 index 00000000000000..2539c2434cb741 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/lodash/package.json @@ -0,0 +1,17 @@ +{ + "name": "lodash", + "version": "4.17.20", + "description": "Lodash modular utilities.", + "keywords": "modules, stdlib, util", + "homepage": "https://lodash.com/", + "repository": "lodash/lodash", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "main": "lodash.js", + "author": "John-David Dalton ", + "contributors": [ + "John-David Dalton ", + "Mathias Bynens " + ], + "scripts": { "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\"" } +} diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/pad.js b/tools/node_modules/@babel/core/node_modules/lodash/pad.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/pad.js rename to tools/node_modules/@babel/core/node_modules/lodash/pad.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/padEnd.js b/tools/node_modules/@babel/core/node_modules/lodash/padEnd.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/padEnd.js rename to tools/node_modules/@babel/core/node_modules/lodash/padEnd.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/padStart.js b/tools/node_modules/@babel/core/node_modules/lodash/padStart.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/padStart.js rename to tools/node_modules/@babel/core/node_modules/lodash/padStart.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/parseInt.js b/tools/node_modules/@babel/core/node_modules/lodash/parseInt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/parseInt.js rename to tools/node_modules/@babel/core/node_modules/lodash/parseInt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/partial.js b/tools/node_modules/@babel/core/node_modules/lodash/partial.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/partial.js rename to tools/node_modules/@babel/core/node_modules/lodash/partial.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/partialRight.js b/tools/node_modules/@babel/core/node_modules/lodash/partialRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/partialRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/partialRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/partition.js b/tools/node_modules/@babel/core/node_modules/lodash/partition.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/partition.js rename to tools/node_modules/@babel/core/node_modules/lodash/partition.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/pick.js b/tools/node_modules/@babel/core/node_modules/lodash/pick.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/pick.js rename to tools/node_modules/@babel/core/node_modules/lodash/pick.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/pickBy.js b/tools/node_modules/@babel/core/node_modules/lodash/pickBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/pickBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/pickBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/plant.js b/tools/node_modules/@babel/core/node_modules/lodash/plant.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/plant.js rename to tools/node_modules/@babel/core/node_modules/lodash/plant.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/property.js b/tools/node_modules/@babel/core/node_modules/lodash/property.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/property.js rename to tools/node_modules/@babel/core/node_modules/lodash/property.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/propertyOf.js b/tools/node_modules/@babel/core/node_modules/lodash/propertyOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/propertyOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/propertyOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/pull.js b/tools/node_modules/@babel/core/node_modules/lodash/pull.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/pull.js rename to tools/node_modules/@babel/core/node_modules/lodash/pull.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/pullAll.js b/tools/node_modules/@babel/core/node_modules/lodash/pullAll.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/pullAll.js rename to tools/node_modules/@babel/core/node_modules/lodash/pullAll.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/pullAllBy.js b/tools/node_modules/@babel/core/node_modules/lodash/pullAllBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/pullAllBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/pullAllBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/pullAllWith.js b/tools/node_modules/@babel/core/node_modules/lodash/pullAllWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/pullAllWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/pullAllWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/pullAt.js b/tools/node_modules/@babel/core/node_modules/lodash/pullAt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/pullAt.js rename to tools/node_modules/@babel/core/node_modules/lodash/pullAt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/random.js b/tools/node_modules/@babel/core/node_modules/lodash/random.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/random.js rename to tools/node_modules/@babel/core/node_modules/lodash/random.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/range.js b/tools/node_modules/@babel/core/node_modules/lodash/range.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/range.js rename to tools/node_modules/@babel/core/node_modules/lodash/range.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/rangeRight.js b/tools/node_modules/@babel/core/node_modules/lodash/rangeRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/rangeRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/rangeRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/rearg.js b/tools/node_modules/@babel/core/node_modules/lodash/rearg.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/rearg.js rename to tools/node_modules/@babel/core/node_modules/lodash/rearg.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/reduce.js b/tools/node_modules/@babel/core/node_modules/lodash/reduce.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/reduce.js rename to tools/node_modules/@babel/core/node_modules/lodash/reduce.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/reduceRight.js b/tools/node_modules/@babel/core/node_modules/lodash/reduceRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/reduceRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/reduceRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/reject.js b/tools/node_modules/@babel/core/node_modules/lodash/reject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/reject.js rename to tools/node_modules/@babel/core/node_modules/lodash/reject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/remove.js b/tools/node_modules/@babel/core/node_modules/lodash/remove.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/remove.js rename to tools/node_modules/@babel/core/node_modules/lodash/remove.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/repeat.js b/tools/node_modules/@babel/core/node_modules/lodash/repeat.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/repeat.js rename to tools/node_modules/@babel/core/node_modules/lodash/repeat.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/replace.js b/tools/node_modules/@babel/core/node_modules/lodash/replace.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/replace.js rename to tools/node_modules/@babel/core/node_modules/lodash/replace.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/rest.js b/tools/node_modules/@babel/core/node_modules/lodash/rest.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/rest.js rename to tools/node_modules/@babel/core/node_modules/lodash/rest.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/result.js b/tools/node_modules/@babel/core/node_modules/lodash/result.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/result.js rename to tools/node_modules/@babel/core/node_modules/lodash/result.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/reverse.js b/tools/node_modules/@babel/core/node_modules/lodash/reverse.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/reverse.js rename to tools/node_modules/@babel/core/node_modules/lodash/reverse.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/round.js b/tools/node_modules/@babel/core/node_modules/lodash/round.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/round.js rename to tools/node_modules/@babel/core/node_modules/lodash/round.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sample.js b/tools/node_modules/@babel/core/node_modules/lodash/sample.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sample.js rename to tools/node_modules/@babel/core/node_modules/lodash/sample.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sampleSize.js b/tools/node_modules/@babel/core/node_modules/lodash/sampleSize.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sampleSize.js rename to tools/node_modules/@babel/core/node_modules/lodash/sampleSize.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/seq.js b/tools/node_modules/@babel/core/node_modules/lodash/seq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/seq.js rename to tools/node_modules/@babel/core/node_modules/lodash/seq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/set.js b/tools/node_modules/@babel/core/node_modules/lodash/set.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/set.js rename to tools/node_modules/@babel/core/node_modules/lodash/set.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/setWith.js b/tools/node_modules/@babel/core/node_modules/lodash/setWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/setWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/setWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/shuffle.js b/tools/node_modules/@babel/core/node_modules/lodash/shuffle.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/shuffle.js rename to tools/node_modules/@babel/core/node_modules/lodash/shuffle.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/size.js b/tools/node_modules/@babel/core/node_modules/lodash/size.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/size.js rename to tools/node_modules/@babel/core/node_modules/lodash/size.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/slice.js b/tools/node_modules/@babel/core/node_modules/lodash/slice.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/slice.js rename to tools/node_modules/@babel/core/node_modules/lodash/slice.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/snakeCase.js b/tools/node_modules/@babel/core/node_modules/lodash/snakeCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/snakeCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/snakeCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/some.js b/tools/node_modules/@babel/core/node_modules/lodash/some.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/some.js rename to tools/node_modules/@babel/core/node_modules/lodash/some.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sortBy.js b/tools/node_modules/@babel/core/node_modules/lodash/sortBy.js similarity index 92% rename from tools/node_modules/babel-eslint/node_modules/lodash/sortBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/sortBy.js index 4ba8f7a0ed9bb5..d756aba6c5ebd3 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/sortBy.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/sortBy.js @@ -22,15 +22,15 @@ var baseFlatten = require('./_baseFlatten'), * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, + * { 'user': 'fred', 'age': 30 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] * * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sortedIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/sortedIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sortedIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/sortedIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sortedIndexBy.js b/tools/node_modules/@babel/core/node_modules/lodash/sortedIndexBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sortedIndexBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/sortedIndexBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sortedIndexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/sortedIndexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sortedIndexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/sortedIndexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sortedLastIndex.js b/tools/node_modules/@babel/core/node_modules/lodash/sortedLastIndex.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sortedLastIndex.js rename to tools/node_modules/@babel/core/node_modules/lodash/sortedLastIndex.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sortedLastIndexBy.js b/tools/node_modules/@babel/core/node_modules/lodash/sortedLastIndexBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sortedLastIndexBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/sortedLastIndexBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sortedLastIndexOf.js b/tools/node_modules/@babel/core/node_modules/lodash/sortedLastIndexOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sortedLastIndexOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/sortedLastIndexOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sortedUniq.js b/tools/node_modules/@babel/core/node_modules/lodash/sortedUniq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sortedUniq.js rename to tools/node_modules/@babel/core/node_modules/lodash/sortedUniq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sortedUniqBy.js b/tools/node_modules/@babel/core/node_modules/lodash/sortedUniqBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sortedUniqBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/sortedUniqBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/split.js b/tools/node_modules/@babel/core/node_modules/lodash/split.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/split.js rename to tools/node_modules/@babel/core/node_modules/lodash/split.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/spread.js b/tools/node_modules/@babel/core/node_modules/lodash/spread.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/spread.js rename to tools/node_modules/@babel/core/node_modules/lodash/spread.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/startCase.js b/tools/node_modules/@babel/core/node_modules/lodash/startCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/startCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/startCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/startsWith.js b/tools/node_modules/@babel/core/node_modules/lodash/startsWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/startsWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/startsWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/string.js b/tools/node_modules/@babel/core/node_modules/lodash/string.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/string.js rename to tools/node_modules/@babel/core/node_modules/lodash/string.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/stubArray.js b/tools/node_modules/@babel/core/node_modules/lodash/stubArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/stubArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/stubArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/stubFalse.js b/tools/node_modules/@babel/core/node_modules/lodash/stubFalse.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/stubFalse.js rename to tools/node_modules/@babel/core/node_modules/lodash/stubFalse.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/stubObject.js b/tools/node_modules/@babel/core/node_modules/lodash/stubObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/stubObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/stubObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/stubString.js b/tools/node_modules/@babel/core/node_modules/lodash/stubString.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/stubString.js rename to tools/node_modules/@babel/core/node_modules/lodash/stubString.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/stubTrue.js b/tools/node_modules/@babel/core/node_modules/lodash/stubTrue.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/stubTrue.js rename to tools/node_modules/@babel/core/node_modules/lodash/stubTrue.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/subtract.js b/tools/node_modules/@babel/core/node_modules/lodash/subtract.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/subtract.js rename to tools/node_modules/@babel/core/node_modules/lodash/subtract.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sum.js b/tools/node_modules/@babel/core/node_modules/lodash/sum.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sum.js rename to tools/node_modules/@babel/core/node_modules/lodash/sum.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/sumBy.js b/tools/node_modules/@babel/core/node_modules/lodash/sumBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/sumBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/sumBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/tail.js b/tools/node_modules/@babel/core/node_modules/lodash/tail.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/tail.js rename to tools/node_modules/@babel/core/node_modules/lodash/tail.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/take.js b/tools/node_modules/@babel/core/node_modules/lodash/take.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/take.js rename to tools/node_modules/@babel/core/node_modules/lodash/take.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/takeRight.js b/tools/node_modules/@babel/core/node_modules/lodash/takeRight.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/takeRight.js rename to tools/node_modules/@babel/core/node_modules/lodash/takeRight.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/takeRightWhile.js b/tools/node_modules/@babel/core/node_modules/lodash/takeRightWhile.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/takeRightWhile.js rename to tools/node_modules/@babel/core/node_modules/lodash/takeRightWhile.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/takeWhile.js b/tools/node_modules/@babel/core/node_modules/lodash/takeWhile.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/takeWhile.js rename to tools/node_modules/@babel/core/node_modules/lodash/takeWhile.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/tap.js b/tools/node_modules/@babel/core/node_modules/lodash/tap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/tap.js rename to tools/node_modules/@babel/core/node_modules/lodash/tap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/template.js b/tools/node_modules/@babel/core/node_modules/lodash/template.js similarity index 96% rename from tools/node_modules/babel-eslint/node_modules/lodash/template.js rename to tools/node_modules/@babel/core/node_modules/lodash/template.js index f71d13024982f0..1556a099afe4e4 100644 --- a/tools/node_modules/babel-eslint/node_modules/lodash/template.js +++ b/tools/node_modules/@babel/core/node_modules/lodash/template.js @@ -169,11 +169,11 @@ function template(string, options, guard) { // Use a sourceURL for easier debugging. // The sourceURL gets injected into the source that's eval-ed, so be careful - // with lookup (in case of e.g. prototype pollution), and strip newlines if any. - // A newline wouldn't be a valid sourceURL anyway, and it'd enable code injection. + // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in + // and escape the comment, thus injecting code that gets evaled. var sourceURL = hasOwnProperty.call(options, 'sourceURL') ? ('//# sourceURL=' + - (options.sourceURL + '').replace(/[\r\n]/g, ' ') + + (options.sourceURL + '').replace(/\s/g, ' ') + '\n') : ''; @@ -206,8 +206,6 @@ function template(string, options, guard) { // If `variable` is not specified wrap a with-statement around the generated // code to add the data object to the top of the scope chain. - // Like with sourceURL, we take care to not check the option's prototype, - // as this configuration is a code injection vector. var variable = hasOwnProperty.call(options, 'variable') && options.variable; if (!variable) { source = 'with (obj) {\n' + source + '\n}\n'; diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/templateSettings.js b/tools/node_modules/@babel/core/node_modules/lodash/templateSettings.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/templateSettings.js rename to tools/node_modules/@babel/core/node_modules/lodash/templateSettings.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/throttle.js b/tools/node_modules/@babel/core/node_modules/lodash/throttle.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/throttle.js rename to tools/node_modules/@babel/core/node_modules/lodash/throttle.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/thru.js b/tools/node_modules/@babel/core/node_modules/lodash/thru.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/thru.js rename to tools/node_modules/@babel/core/node_modules/lodash/thru.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/times.js b/tools/node_modules/@babel/core/node_modules/lodash/times.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/times.js rename to tools/node_modules/@babel/core/node_modules/lodash/times.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toArray.js b/tools/node_modules/@babel/core/node_modules/lodash/toArray.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toArray.js rename to tools/node_modules/@babel/core/node_modules/lodash/toArray.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toFinite.js b/tools/node_modules/@babel/core/node_modules/lodash/toFinite.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toFinite.js rename to tools/node_modules/@babel/core/node_modules/lodash/toFinite.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toInteger.js b/tools/node_modules/@babel/core/node_modules/lodash/toInteger.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toInteger.js rename to tools/node_modules/@babel/core/node_modules/lodash/toInteger.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toIterator.js b/tools/node_modules/@babel/core/node_modules/lodash/toIterator.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toIterator.js rename to tools/node_modules/@babel/core/node_modules/lodash/toIterator.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toJSON.js b/tools/node_modules/@babel/core/node_modules/lodash/toJSON.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toJSON.js rename to tools/node_modules/@babel/core/node_modules/lodash/toJSON.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toLength.js b/tools/node_modules/@babel/core/node_modules/lodash/toLength.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toLength.js rename to tools/node_modules/@babel/core/node_modules/lodash/toLength.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toLower.js b/tools/node_modules/@babel/core/node_modules/lodash/toLower.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toLower.js rename to tools/node_modules/@babel/core/node_modules/lodash/toLower.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toNumber.js b/tools/node_modules/@babel/core/node_modules/lodash/toNumber.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toNumber.js rename to tools/node_modules/@babel/core/node_modules/lodash/toNumber.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toPairs.js b/tools/node_modules/@babel/core/node_modules/lodash/toPairs.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toPairs.js rename to tools/node_modules/@babel/core/node_modules/lodash/toPairs.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toPairsIn.js b/tools/node_modules/@babel/core/node_modules/lodash/toPairsIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toPairsIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/toPairsIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toPath.js b/tools/node_modules/@babel/core/node_modules/lodash/toPath.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toPath.js rename to tools/node_modules/@babel/core/node_modules/lodash/toPath.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toPlainObject.js b/tools/node_modules/@babel/core/node_modules/lodash/toPlainObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toPlainObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/toPlainObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toSafeInteger.js b/tools/node_modules/@babel/core/node_modules/lodash/toSafeInteger.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toSafeInteger.js rename to tools/node_modules/@babel/core/node_modules/lodash/toSafeInteger.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toString.js b/tools/node_modules/@babel/core/node_modules/lodash/toString.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toString.js rename to tools/node_modules/@babel/core/node_modules/lodash/toString.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/toUpper.js b/tools/node_modules/@babel/core/node_modules/lodash/toUpper.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/toUpper.js rename to tools/node_modules/@babel/core/node_modules/lodash/toUpper.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/transform.js b/tools/node_modules/@babel/core/node_modules/lodash/transform.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/transform.js rename to tools/node_modules/@babel/core/node_modules/lodash/transform.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/trim.js b/tools/node_modules/@babel/core/node_modules/lodash/trim.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/trim.js rename to tools/node_modules/@babel/core/node_modules/lodash/trim.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/trimEnd.js b/tools/node_modules/@babel/core/node_modules/lodash/trimEnd.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/trimEnd.js rename to tools/node_modules/@babel/core/node_modules/lodash/trimEnd.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/trimStart.js b/tools/node_modules/@babel/core/node_modules/lodash/trimStart.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/trimStart.js rename to tools/node_modules/@babel/core/node_modules/lodash/trimStart.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/truncate.js b/tools/node_modules/@babel/core/node_modules/lodash/truncate.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/truncate.js rename to tools/node_modules/@babel/core/node_modules/lodash/truncate.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/unary.js b/tools/node_modules/@babel/core/node_modules/lodash/unary.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/unary.js rename to tools/node_modules/@babel/core/node_modules/lodash/unary.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/unescape.js b/tools/node_modules/@babel/core/node_modules/lodash/unescape.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/unescape.js rename to tools/node_modules/@babel/core/node_modules/lodash/unescape.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/union.js b/tools/node_modules/@babel/core/node_modules/lodash/union.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/union.js rename to tools/node_modules/@babel/core/node_modules/lodash/union.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/unionBy.js b/tools/node_modules/@babel/core/node_modules/lodash/unionBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/unionBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/unionBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/unionWith.js b/tools/node_modules/@babel/core/node_modules/lodash/unionWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/unionWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/unionWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/uniq.js b/tools/node_modules/@babel/core/node_modules/lodash/uniq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/uniq.js rename to tools/node_modules/@babel/core/node_modules/lodash/uniq.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/uniqBy.js b/tools/node_modules/@babel/core/node_modules/lodash/uniqBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/uniqBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/uniqBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/uniqWith.js b/tools/node_modules/@babel/core/node_modules/lodash/uniqWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/uniqWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/uniqWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/uniqueId.js b/tools/node_modules/@babel/core/node_modules/lodash/uniqueId.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/uniqueId.js rename to tools/node_modules/@babel/core/node_modules/lodash/uniqueId.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/unset.js b/tools/node_modules/@babel/core/node_modules/lodash/unset.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/unset.js rename to tools/node_modules/@babel/core/node_modules/lodash/unset.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/unzip.js b/tools/node_modules/@babel/core/node_modules/lodash/unzip.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/unzip.js rename to tools/node_modules/@babel/core/node_modules/lodash/unzip.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/unzipWith.js b/tools/node_modules/@babel/core/node_modules/lodash/unzipWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/unzipWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/unzipWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/update.js b/tools/node_modules/@babel/core/node_modules/lodash/update.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/update.js rename to tools/node_modules/@babel/core/node_modules/lodash/update.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/updateWith.js b/tools/node_modules/@babel/core/node_modules/lodash/updateWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/updateWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/updateWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/upperCase.js b/tools/node_modules/@babel/core/node_modules/lodash/upperCase.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/upperCase.js rename to tools/node_modules/@babel/core/node_modules/lodash/upperCase.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/upperFirst.js b/tools/node_modules/@babel/core/node_modules/lodash/upperFirst.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/upperFirst.js rename to tools/node_modules/@babel/core/node_modules/lodash/upperFirst.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/util.js b/tools/node_modules/@babel/core/node_modules/lodash/util.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/util.js rename to tools/node_modules/@babel/core/node_modules/lodash/util.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/value.js b/tools/node_modules/@babel/core/node_modules/lodash/value.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/value.js rename to tools/node_modules/@babel/core/node_modules/lodash/value.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/valueOf.js b/tools/node_modules/@babel/core/node_modules/lodash/valueOf.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/valueOf.js rename to tools/node_modules/@babel/core/node_modules/lodash/valueOf.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/values.js b/tools/node_modules/@babel/core/node_modules/lodash/values.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/values.js rename to tools/node_modules/@babel/core/node_modules/lodash/values.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/valuesIn.js b/tools/node_modules/@babel/core/node_modules/lodash/valuesIn.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/valuesIn.js rename to tools/node_modules/@babel/core/node_modules/lodash/valuesIn.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/without.js b/tools/node_modules/@babel/core/node_modules/lodash/without.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/without.js rename to tools/node_modules/@babel/core/node_modules/lodash/without.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/words.js b/tools/node_modules/@babel/core/node_modules/lodash/words.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/words.js rename to tools/node_modules/@babel/core/node_modules/lodash/words.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/wrap.js b/tools/node_modules/@babel/core/node_modules/lodash/wrap.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/wrap.js rename to tools/node_modules/@babel/core/node_modules/lodash/wrap.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/wrapperAt.js b/tools/node_modules/@babel/core/node_modules/lodash/wrapperAt.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/wrapperAt.js rename to tools/node_modules/@babel/core/node_modules/lodash/wrapperAt.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/wrapperChain.js b/tools/node_modules/@babel/core/node_modules/lodash/wrapperChain.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/wrapperChain.js rename to tools/node_modules/@babel/core/node_modules/lodash/wrapperChain.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/wrapperLodash.js b/tools/node_modules/@babel/core/node_modules/lodash/wrapperLodash.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/wrapperLodash.js rename to tools/node_modules/@babel/core/node_modules/lodash/wrapperLodash.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/wrapperReverse.js b/tools/node_modules/@babel/core/node_modules/lodash/wrapperReverse.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/wrapperReverse.js rename to tools/node_modules/@babel/core/node_modules/lodash/wrapperReverse.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/wrapperValue.js b/tools/node_modules/@babel/core/node_modules/lodash/wrapperValue.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/wrapperValue.js rename to tools/node_modules/@babel/core/node_modules/lodash/wrapperValue.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/xor.js b/tools/node_modules/@babel/core/node_modules/lodash/xor.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/xor.js rename to tools/node_modules/@babel/core/node_modules/lodash/xor.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/xorBy.js b/tools/node_modules/@babel/core/node_modules/lodash/xorBy.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/xorBy.js rename to tools/node_modules/@babel/core/node_modules/lodash/xorBy.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/xorWith.js b/tools/node_modules/@babel/core/node_modules/lodash/xorWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/xorWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/xorWith.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/zip.js b/tools/node_modules/@babel/core/node_modules/lodash/zip.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/zip.js rename to tools/node_modules/@babel/core/node_modules/lodash/zip.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/zipObject.js b/tools/node_modules/@babel/core/node_modules/lodash/zipObject.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/zipObject.js rename to tools/node_modules/@babel/core/node_modules/lodash/zipObject.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/zipObjectDeep.js b/tools/node_modules/@babel/core/node_modules/lodash/zipObjectDeep.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/zipObjectDeep.js rename to tools/node_modules/@babel/core/node_modules/lodash/zipObjectDeep.js diff --git a/tools/node_modules/babel-eslint/node_modules/lodash/zipWith.js b/tools/node_modules/@babel/core/node_modules/lodash/zipWith.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/lodash/zipWith.js rename to tools/node_modules/@babel/core/node_modules/lodash/zipWith.js diff --git a/tools/node_modules/@babel/core/node_modules/minimist/LICENSE b/tools/node_modules/@babel/core/node_modules/minimist/LICENSE new file mode 100644 index 00000000000000..ee27ba4b4412b0 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/minimist/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/@babel/core/node_modules/minimist/index.js b/tools/node_modules/@babel/core/node_modules/minimist/index.js new file mode 100644 index 00000000000000..d2afe5e4d4056e --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/minimist/index.js @@ -0,0 +1,245 @@ +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {}, unknownFn: null }; + + if (typeof opts['unknown'] === 'function') { + flags.unknownFn = opts['unknown']; + } + + if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { + flags.allBools = true; + } else { + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + } + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + if (aliases[key]) { + flags.strings[aliases[key]] = true; + } + }); + + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } + + function argDefined(key, arg) { + return (flags.allBools && /^--[^=]+$/.test(arg)) || + flags.strings[key] || flags.bools[key] || aliases[key]; + } + + function setArg (key, val, arg) { + if (arg && flags.unknownFn && !argDefined(key, arg)) { + if (flags.unknownFn(arg) === false) return; + } + + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + function setKey (obj, keys, value) { + var o = obj; + for (var i = 0; i < keys.length-1; i++) { + var key = keys[i]; + if (key === '__proto__') return; + if (o[key] === undefined) o[key] = {}; + if (o[key] === Object.prototype || o[key] === Number.prototype + || o[key] === String.prototype) o[key] = {}; + if (o[key] === Array.prototype) o[key] = []; + o = o[key]; + } + + var key = keys[keys.length - 1]; + if (key === '__proto__') return; + if (o === Object.prototype || o === Number.prototype + || o === String.prototype) o = {}; + if (o === Array.prototype) o = []; + if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } + } + + function aliasIsBoolean(key) { + return aliases[key].some(function (x) { + return flags.bools[x]; + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + var key = m[1]; + var value = m[2]; + if (flags.bools[key]) { + value = value !== 'false'; + } + setArg(key, value, arg); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false, arg); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && !flags.allBools + && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, next, arg); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true', arg); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next, arg) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { + setArg(letters[j], next.split('=')[1], arg); + broken = true; + break; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next, arg); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2), arg); + broken = true; + break; + } + else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, args[i+1], arg); + i++; + } + else if (args[i+1] && /^(true|false)$/.test(args[i+1])) { + setArg(key, args[i+1] === 'true', arg); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + } + else { + if (!flags.unknownFn || flags.unknownFn(arg) !== false) { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + if (opts.stopEarly) { + argv._.push.apply(argv._, args.slice(i + 1)); + break; + } + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + if (opts['--']) { + argv['--'] = new Array(); + notFlags.forEach(function(key) { + argv['--'].push(key); + }); + } + else { + notFlags.forEach(function(key) { + argv._.push(key); + }); + } + + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + diff --git a/tools/node_modules/@babel/core/node_modules/minimist/package.json b/tools/node_modules/@babel/core/node_modules/minimist/package.json new file mode 100644 index 00000000000000..c091d41375f9aa --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/minimist/package.json @@ -0,0 +1,45 @@ +{ + "name": "minimist", + "version": "1.2.5", + "description": "parse argument options", + "main": "index.js", + "devDependencies": { + "covert": "^1.0.0", + "tap": "~0.4.0", + "tape": "^3.5.0" + }, + "scripts": { + "test": "tap test/*.js", + "coverage": "covert test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/minimist.git" + }, + "homepage": "https://github.com/substack/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT" +} diff --git a/tools/node_modules/@babel/core/node_modules/minimist/readme.markdown b/tools/node_modules/@babel/core/node_modules/minimist/readme.markdown new file mode 100644 index 00000000000000..5fd97ab11ee9d8 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/minimist/readme.markdown @@ -0,0 +1,95 @@ +# minimist + +parse argument options + +This module is the guts of optimist's argument parser without all the +fanciful decoration. + +# example + +``` js +var argv = require('minimist')(process.argv.slice(2)); +console.log(argv); +``` + +``` +$ node example/parse.js -a beep -b boop +{ _: [], a: 'beep', b: 'boop' } +``` + +``` +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +{ _: [ 'foo', 'bar', 'baz' ], + x: 3, + y: 4, + n: 5, + a: true, + b: true, + c: true, + beep: 'boop' } +``` + +# security + +Previous versions had a prototype pollution bug that could cause privilege +escalation in some circumstances when handling untrusted user input. + +Please use version 1.2.3 or later: https://snyk.io/vuln/SNYK-JS-MINIMIST-559764 + +# methods + +``` js +var parseArgs = require('minimist') +``` + +## var argv = parseArgs(args, opts={}) + +Return an argument object `argv` populated with the array arguments from `args`. + +`argv._` contains all the arguments that didn't have an option associated with +them. + +Numeric-looking arguments will be returned as numbers unless `opts.string` or +`opts.boolean` is set for that argument name. + +Any arguments after `'--'` will not be parsed and will end up in `argv._`. + +options can be: + +* `opts.string` - a string or array of strings argument names to always treat as +strings +* `opts.boolean` - a boolean, string or array of strings to always treat as +booleans. if `true` will treat all double hyphenated arguments without equal signs +as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) +* `opts.alias` - an object mapping string names to strings or arrays of string +argument names to use as aliases +* `opts.default` - an object mapping string argument names to default values +* `opts.stopEarly` - when true, populate `argv._` with everything after the +first non-option +* `opts['--']` - when true, populate `argv._` with everything before the `--` +and `argv['--']` with everything after the `--`. Here's an example: + + ``` + > require('./')('one two three -- four five --six'.split(' '), { '--': true }) + { _: [ 'one', 'two', 'three' ], + '--': [ 'four', 'five', '--six' ] } + ``` + + Note that with `opts['--']` set, parsing for arguments still stops after the + `--`. + +* `opts.unknown` - a function which is invoked with a command line parameter not +defined in the `opts` configuration object. If the function returns `false`, the +unknown option is not added to `argv`. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install minimist +``` + +# license + +MIT diff --git a/tools/node_modules/babel-eslint/node_modules/ms/index.js b/tools/node_modules/@babel/core/node_modules/ms/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/ms/index.js rename to tools/node_modules/@babel/core/node_modules/ms/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/ms/license.md b/tools/node_modules/@babel/core/node_modules/ms/license.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/ms/license.md rename to tools/node_modules/@babel/core/node_modules/ms/license.md diff --git a/tools/node_modules/babel-eslint/node_modules/ms/package.json b/tools/node_modules/@babel/core/node_modules/ms/package.json similarity index 69% rename from tools/node_modules/babel-eslint/node_modules/ms/package.json rename to tools/node_modules/@babel/core/node_modules/ms/package.json index 7192a30c57c910..eea666e1fb03d6 100644 --- a/tools/node_modules/babel-eslint/node_modules/ms/package.json +++ b/tools/node_modules/@babel/core/node_modules/ms/package.json @@ -1,16 +1,16 @@ { - "bugs": { - "url": "https://github.com/zeit/ms/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "ms", + "version": "2.1.2", "description": "Tiny millisecond conversion utility", - "devDependencies": { - "eslint": "4.12.1", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1" + "repository": "zeit/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" }, "eslintConfig": { "extends": "eslint:recommended", @@ -19,11 +19,6 @@ "es6": true } }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/zeit/ms#readme", - "license": "MIT", "lint-staged": { "*.js": [ "npm run lint", @@ -31,16 +26,12 @@ "git add" ] }, - "main": "./index", - "name": "ms", - "repository": { - "type": "git", - "url": "git+https://github.com/zeit/ms.git" - }, - "scripts": { - "lint": "eslint lib/* bin/*", - "precommit": "lint-staged", - "test": "mocha tests.js" - }, - "version": "2.1.2" -} \ No newline at end of file + "license": "MIT", + "devDependencies": { + "eslint": "4.12.1", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1" + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/ms/readme.md b/tools/node_modules/@babel/core/node_modules/ms/readme.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/ms/readme.md rename to tools/node_modules/@babel/core/node_modules/ms/readme.md diff --git a/tools/node_modules/babel-eslint/node_modules/path-parse/LICENSE b/tools/node_modules/@babel/core/node_modules/path-parse/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/path-parse/LICENSE rename to tools/node_modules/@babel/core/node_modules/path-parse/LICENSE diff --git a/tools/node_modules/babel-eslint/node_modules/path-parse/README.md b/tools/node_modules/@babel/core/node_modules/path-parse/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/path-parse/README.md rename to tools/node_modules/@babel/core/node_modules/path-parse/README.md diff --git a/tools/node_modules/babel-eslint/node_modules/path-parse/index.js b/tools/node_modules/@babel/core/node_modules/path-parse/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/path-parse/index.js rename to tools/node_modules/@babel/core/node_modules/path-parse/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/path-parse/package.json b/tools/node_modules/@babel/core/node_modules/path-parse/package.json similarity index 69% rename from tools/node_modules/babel-eslint/node_modules/path-parse/package.json rename to tools/node_modules/@babel/core/node_modules/path-parse/package.json index 49b06b414272ce..21332bb14f8b7f 100644 --- a/tools/node_modules/babel-eslint/node_modules/path-parse/package.json +++ b/tools/node_modules/@babel/core/node_modules/path-parse/package.json @@ -1,15 +1,15 @@ { - "author": { - "name": "Javier Blanco", - "email": "http://jbgutierrez.info" + "name": "path-parse", + "version": "1.0.6", + "description": "Node.js path.parse() ponyfill", + "main": "index.js", + "scripts": { + "test": "node test.js" }, - "bugs": { - "url": "https://github.com/jbgutierrez/path-parse/issues" + "repository": { + "type": "git", + "url": "https://github.com/jbgutierrez/path-parse.git" }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node.js path.parse() ponyfill", - "homepage": "https://github.com/jbgutierrez/path-parse#readme", "keywords": [ "path", "paths", @@ -24,15 +24,10 @@ "polyfill", "shim" ], + "author": "Javier Blanco ", "license": "MIT", - "main": "index.js", - "name": "path-parse", - "repository": { - "type": "git", - "url": "git+https://github.com/jbgutierrez/path-parse.git" - }, - "scripts": { - "test": "node test.js" + "bugs": { + "url": "https://github.com/jbgutierrez/path-parse/issues" }, - "version": "1.0.6" -} \ No newline at end of file + "homepage": "https://github.com/jbgutierrez/path-parse#readme" +} diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/LICENSE b/tools/node_modules/@babel/core/node_modules/resolve/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/resolve/LICENSE rename to tools/node_modules/@babel/core/node_modules/resolve/LICENSE diff --git a/tools/node_modules/@babel/core/node_modules/resolve/index.js b/tools/node_modules/@babel/core/node_modules/resolve/index.js new file mode 100644 index 00000000000000..125d8146423596 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/resolve/index.js @@ -0,0 +1,6 @@ +var async = require('./lib/async'); +async.core = require('./lib/core'); +async.isCore = require('./lib/is-core'); +async.sync = require('./lib/sync'); + +module.exports = async; diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/async.js b/tools/node_modules/@babel/core/node_modules/resolve/lib/async.js similarity index 58% rename from tools/node_modules/babel-eslint/node_modules/resolve/lib/async.js rename to tools/node_modules/@babel/core/node_modules/resolve/lib/async.js index 004b2798baf0c2..29285079451b15 100644 --- a/tools/node_modules/babel-eslint/node_modules/resolve/lib/async.js +++ b/tools/node_modules/@babel/core/node_modules/resolve/lib/async.js @@ -1,9 +1,11 @@ -var core = require('./core'); var fs = require('fs'); var path = require('path'); -var caller = require('./caller.js'); -var nodeModulesPaths = require('./node-modules-paths.js'); -var normalizeOptions = require('./normalize-options.js'); +var caller = require('./caller'); +var nodeModulesPaths = require('./node-modules-paths'); +var normalizeOptions = require('./normalize-options'); +var isCore = require('is-core-module'); + +var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; var defaultIsFile = function isFile(file, cb) { fs.stat(file, function (err, stat) { @@ -25,17 +27,29 @@ var defaultIsDir = function isDirectory(dir, cb) { }); }; -var maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts, cb) { +var defaultRealpath = function realpath(x, cb) { + realpathFS(x, function (realpathErr, realPath) { + if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr); + else cb(null, realpathErr ? x : realPath); + }); +}; + +var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) { if (opts && opts.preserveSymlinks === false) { - fs.realpath(x, function (realPathErr, realPath) { - if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr); - else cb(null, realPathErr ? x : realPath); - }); + realpath(x, cb); } else { cb(null, x); } }; +var getPackageCandidates = function getPackageCandidates(x, start, opts) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + dirs[i] = path.join(dirs[i], x); + } + return dirs; +}; + module.exports = function resolve(x, options, callback) { var cb = callback; var opts = options; @@ -55,8 +69,11 @@ module.exports = function resolve(x, options, callback) { var isFile = opts.isFile || defaultIsFile; var isDirectory = opts.isDirectory || defaultIsDir; var readFile = opts.readFile || fs.readFile; + var realpath = opts.realpath || defaultRealpath; + var packageIterator = opts.packageIterator; var extensions = opts.extensions || ['.js']; + var includeCoreModules = opts.includeCoreModules !== false; var basedir = opts.basedir || path.dirname(caller()); var parent = opts.filename || basedir; @@ -65,7 +82,8 @@ module.exports = function resolve(x, options, callback) { // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory var absoluteStart = path.resolve(basedir); - maybeUnwrapSymlink( + maybeRealpath( + realpath, absoluteStart, opts, function (err, realStart) { @@ -78,15 +96,16 @@ module.exports = function resolve(x, options, callback) { function init(basedir) { if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { res = path.resolve(basedir, x); - if (x === '..' || x.slice(-1) === '/') res += '/'; + if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; if ((/\/$/).test(x) && res === basedir) { loadAsDirectory(res, opts.package, onfile); } else loadAsFile(res, opts.package, onfile); + } else if (includeCoreModules && isCore(x)) { + return cb(null, x); } else loadNodeModules(x, basedir, function (err, n, pkg) { if (err) cb(err); - else if (core[x]) return cb(null, x); else if (n) { - return maybeUnwrapSymlink(n, opts, function (err, realN) { + return maybeRealpath(realpath, n, opts, function (err, realN) { if (err) { cb(err); } else { @@ -107,7 +126,7 @@ module.exports = function resolve(x, options, callback) { else loadAsDirectory(res, function (err, d, pkg) { if (err) cb(err); else if (d) { - maybeUnwrapSymlink(d, opts, function (err, realD) { + maybeRealpath(realpath, d, opts, function (err, realD) { if (err) { cb(err); } else { @@ -171,19 +190,22 @@ module.exports = function resolve(x, options, callback) { } if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null); - var pkgfile = path.join(dir, 'package.json'); - isFile(pkgfile, function (err, ex) { - // on err, ex is false - if (!ex) return loadpkg(path.dirname(dir), cb); + maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) { + if (unwrapErr) return loadpkg(path.dirname(dir), cb); + var pkgfile = path.join(pkgdir, 'package.json'); + isFile(pkgfile, function (err, ex) { + // on err, ex is false + if (!ex) return loadpkg(path.dirname(dir), cb); - readFile(pkgfile, function (err, body) { - if (err) cb(err); - try { var pkg = JSON.parse(body); } catch (jsonErr) {} + readFile(pkgfile, function (err, body) { + if (err) cb(err); + try { var pkg = JSON.parse(body); } catch (jsonErr) {} - if (pkg && opts.packageFilter) { - pkg = opts.packageFilter(pkg, pkgfile); - } - cb(null, pkg, dir); + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + cb(null, pkg, dir); + }); }); }); } @@ -196,46 +218,49 @@ module.exports = function resolve(x, options, callback) { fpkg = opts.package; } - var pkgfile = path.join(x, 'package.json'); - isFile(pkgfile, function (err, ex) { - if (err) return cb(err); - if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); - - readFile(pkgfile, function (err, body) { + maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) { + if (unwrapErr) return cb(unwrapErr); + var pkgfile = path.join(pkgdir, 'package.json'); + isFile(pkgfile, function (err, ex) { if (err) return cb(err); - try { - var pkg = JSON.parse(body); - } catch (jsonErr) {} + if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); - if (opts.packageFilter) { - pkg = opts.packageFilter(pkg, pkgfile); - } + readFile(pkgfile, function (err, body) { + if (err) return cb(err); + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} - if (pkg.main) { - if (typeof pkg.main !== 'string') { - var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); - mainError.code = 'INVALID_PACKAGE_MAIN'; - return cb(mainError); + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); } - if (pkg.main === '.' || pkg.main === './') { - pkg.main = 'index'; - } - loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { - if (err) return cb(err); - if (m) return cb(null, m, pkg); - if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); - var dir = path.resolve(x, pkg.main); - loadAsDirectory(dir, pkg, function (err, n, pkg) { + if (pkg && pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + return cb(mainError); + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { if (err) return cb(err); - if (n) return cb(null, n, pkg); - loadAsFile(path.join(x, 'index'), pkg, cb); + if (m) return cb(null, m, pkg); + if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); + + var dir = path.resolve(x, pkg.main); + loadAsDirectory(dir, pkg, function (err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + loadAsFile(path.join(x, 'index'), pkg, cb); + }); }); - }); - return; - } + return; + } - loadAsFile(path.join(x, '/index'), pkg, cb); + loadAsFile(path.join(x, '/index'), pkg, cb); + }); }); }); } @@ -244,19 +269,18 @@ module.exports = function resolve(x, options, callback) { if (dirs.length === 0) return cb(null, undefined); var dir = dirs[0]; - isDirectory(dir, isdir); + isDirectory(path.dirname(dir), isdir); function isdir(err, isdir) { if (err) return cb(err); if (!isdir) return processDirs(cb, dirs.slice(1)); - var file = path.join(dir, x); - loadAsFile(file, opts.package, onfile); + loadAsFile(dir, opts.package, onfile); } function onfile(err, m, pkg) { if (err) return cb(err); if (m) return cb(null, m, pkg); - loadAsDirectory(path.join(dir, x), opts.package, ondir); + loadAsDirectory(dir, opts.package, ondir); } function ondir(err, n, pkg) { @@ -266,6 +290,10 @@ module.exports = function resolve(x, options, callback) { } } function loadNodeModules(x, start, cb) { - processDirs(cb, nodeModulesPaths(start, opts, x)); + var thunk = function () { return getPackageCandidates(x, start, opts); }; + processDirs( + cb, + packageIterator ? packageIterator(x, start, thunk, opts) : thunk() + ); } }; diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/caller.js b/tools/node_modules/@babel/core/node_modules/resolve/lib/caller.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/resolve/lib/caller.js rename to tools/node_modules/@babel/core/node_modules/resolve/lib/caller.js diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/core.js b/tools/node_modules/@babel/core/node_modules/resolve/lib/core.js similarity index 93% rename from tools/node_modules/babel-eslint/node_modules/resolve/lib/core.js rename to tools/node_modules/@babel/core/node_modules/resolve/lib/core.js index 0877650ccad4e8..c417d23c5a8ff7 100644 --- a/tools/node_modules/babel-eslint/node_modules/resolve/lib/core.js +++ b/tools/node_modules/@babel/core/node_modules/resolve/lib/core.js @@ -6,8 +6,8 @@ function specifierIncluded(specifier) { var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); for (var i = 0; i < 3; ++i) { - var cur = Number(current[i] || 0); - var ver = Number(versionParts[i] || 0); + var cur = parseInt(current[i] || 0, 10); + var ver = parseInt(versionParts[i] || 0, 10); if (cur === ver) { continue; // eslint-disable-line no-restricted-syntax, no-continue } diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/core.json b/tools/node_modules/@babel/core/node_modules/resolve/lib/core.json similarity index 87% rename from tools/node_modules/babel-eslint/node_modules/resolve/lib/core.json rename to tools/node_modules/@babel/core/node_modules/resolve/lib/core.json index 12a6ac7e6c364b..226198f89b5ef0 100644 --- a/tools/node_modules/babel-eslint/node_modules/resolve/lib/core.json +++ b/tools/node_modules/@babel/core/node_modules/resolve/lib/core.json @@ -1,5 +1,6 @@ { "assert": true, + "assert/strict": ">= 15", "async_hooks": ">= 8", "buffer_ieee754": "< 0.9.7", "buffer": true, @@ -11,12 +12,14 @@ "_debug_agent": ">= 1 && < 8", "_debugger": "< 8", "dgram": true, + "diagnostics_channel": ">= 15.1", "dns": true, - "domain": true, + "dns/promises": ">= 15", + "domain": ">= 0.7.12", "events": true, "freelist": "< 6", "fs": true, - "fs/promises": ">= 10 && < 10.1", + "fs/promises": [">= 10 && < 10.1", ">= 14"], "_http_agent": ">= 0.11.1", "_http_client": ">= 0.11.1", "_http_common": ">= 0.11.1", @@ -49,9 +52,11 @@ "_stream_readable": ">= 0.9.4", "_stream_writable": ">= 0.9.4", "stream": true, + "stream/promises": ">= 15", "string_decoder": true, - "sys": true, + "sys": [">= 0.6 && < 0.7", ">= 0.8"], "timers": true, + "timers/promises": ">= 15", "_tls_common": ">= 0.11.13", "_tls_legacy": ">= 0.11.3 && < 10", "_tls_wrap": ">= 0.11.3", @@ -69,6 +74,7 @@ "v8/tools/splaytree": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], "v8": ">= 1", "vm": true, + "wasi": ">= 13.4 && < 13.5", "worker_threads": ">= 11.7", "zlib": true } diff --git a/tools/node_modules/@babel/core/node_modules/resolve/lib/is-core.js b/tools/node_modules/@babel/core/node_modules/resolve/lib/is-core.js new file mode 100644 index 00000000000000..537f5c782ffe55 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/resolve/lib/is-core.js @@ -0,0 +1,5 @@ +var isCoreModule = require('is-core-module'); + +module.exports = function isCore(x) { + return isCoreModule(x); +}; diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/node-modules-paths.js b/tools/node_modules/@babel/core/node_modules/resolve/lib/node-modules-paths.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/resolve/lib/node-modules-paths.js rename to tools/node_modules/@babel/core/node_modules/resolve/lib/node-modules-paths.js diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/normalize-options.js b/tools/node_modules/@babel/core/node_modules/resolve/lib/normalize-options.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/resolve/lib/normalize-options.js rename to tools/node_modules/@babel/core/node_modules/resolve/lib/normalize-options.js diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/lib/sync.js b/tools/node_modules/@babel/core/node_modules/resolve/lib/sync.js similarity index 63% rename from tools/node_modules/babel-eslint/node_modules/resolve/lib/sync.js rename to tools/node_modules/@babel/core/node_modules/resolve/lib/sync.js index e8d83de5b6d3b2..d5308c926e498b 100644 --- a/tools/node_modules/babel-eslint/node_modules/resolve/lib/sync.js +++ b/tools/node_modules/@babel/core/node_modules/resolve/lib/sync.js @@ -1,9 +1,11 @@ -var core = require('./core'); +var isCore = require('is-core-module'); var fs = require('fs'); var path = require('path'); -var caller = require('./caller.js'); -var nodeModulesPaths = require('./node-modules-paths.js'); -var normalizeOptions = require('./normalize-options.js'); +var caller = require('./caller'); +var nodeModulesPaths = require('./node-modules-paths'); +var normalizeOptions = require('./normalize-options'); + +var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; var defaultIsFile = function isFile(file) { try { @@ -25,20 +27,33 @@ var defaultIsDir = function isDirectory(dir) { return stat.isDirectory(); }; -var maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts) { - if (opts && opts.preserveSymlinks === false) { - try { - return fs.realpathSync(x); - } catch (realPathErr) { - if (realPathErr.code !== 'ENOENT') { - throw realPathErr; - } +var defaultRealpathSync = function realpathSync(x) { + try { + return realpathFS(x); + } catch (realpathErr) { + if (realpathErr.code !== 'ENOENT') { + throw realpathErr; } } return x; }; -module.exports = function (x, options) { +var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) { + if (opts && opts.preserveSymlinks === false) { + return realpathSync(x); + } + return x; +}; + +var getPackageCandidates = function getPackageCandidates(x, start, opts) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + dirs[i] = path.join(dirs[i], x); + } + return dirs; +}; + +module.exports = function resolveSync(x, options) { if (typeof x !== 'string') { throw new TypeError('Path must be a string.'); } @@ -47,30 +62,31 @@ module.exports = function (x, options) { var isFile = opts.isFile || defaultIsFile; var readFileSync = opts.readFileSync || fs.readFileSync; var isDirectory = opts.isDirectory || defaultIsDir; + var realpathSync = opts.realpathSync || defaultRealpathSync; + var packageIterator = opts.packageIterator; var extensions = opts.extensions || ['.js']; + var includeCoreModules = opts.includeCoreModules !== false; var basedir = opts.basedir || path.dirname(caller()); var parent = opts.filename || basedir; opts.paths = opts.paths || []; // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory - var absoluteStart = maybeUnwrapSymlink(path.resolve(basedir), opts); + var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts); if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { var res = path.resolve(absoluteStart, x); - if (x === '..' || x.slice(-1) === '/') res += '/'; + if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; var m = loadAsFileSync(res) || loadAsDirectorySync(res); - if (m) return maybeUnwrapSymlink(m, opts); - } else if (core[x]) { + if (m) return maybeRealpathSync(realpathSync, m, opts); + } else if (includeCoreModules && isCore(x)) { return x; } else { var n = loadNodeModulesSync(x, absoluteStart); - if (n) return maybeUnwrapSymlink(n, opts); + if (n) return maybeRealpathSync(realpathSync, n, opts); } - if (core[x]) return x; - var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); err.code = 'MODULE_NOT_FOUND'; throw err; @@ -105,7 +121,7 @@ module.exports = function (x, options) { } if ((/[/\\]node_modules[/\\]*$/).test(dir)) return; - var pkgfile = path.join(dir, 'package.json'); + var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json'); if (!isFile(pkgfile)) { return loadpkg(path.dirname(dir)); @@ -118,25 +134,27 @@ module.exports = function (x, options) { } catch (jsonErr) {} if (pkg && opts.packageFilter) { - pkg = opts.packageFilter(pkg, dir); + // v2 will pass pkgfile + pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment } return { pkg: pkg, dir: dir }; } function loadAsDirectorySync(x) { - var pkgfile = path.join(x, '/package.json'); + var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json'); if (isFile(pkgfile)) { try { var body = readFileSync(pkgfile, 'UTF8'); var pkg = JSON.parse(body); } catch (e) {} - if (opts.packageFilter) { - pkg = opts.packageFilter(pkg, x); + if (pkg && opts.packageFilter) { + // v2 will pass pkgfile + pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment } - if (pkg.main) { + if (pkg && pkg.main) { if (typeof pkg.main !== 'string') { var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); mainError.code = 'INVALID_PACKAGE_MAIN'; @@ -158,13 +176,15 @@ module.exports = function (x, options) { } function loadNodeModulesSync(x, start) { - var dirs = nodeModulesPaths(start, opts, x); + var thunk = function () { return getPackageCandidates(x, start, opts); }; + var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk(); + for (var i = 0; i < dirs.length; i++) { var dir = dirs[i]; - if (isDirectory(dir)) { - var m = loadAsFileSync(path.join(dir, '/', x)); + if (isDirectory(path.dirname(dir))) { + var m = loadAsFileSync(dir); if (m) return m; - var n = loadAsDirectorySync(path.join(dir, '/', x)); + var n = loadAsDirectorySync(dir); if (n) return n; } } diff --git a/tools/node_modules/@babel/core/node_modules/resolve/package.json b/tools/node_modules/@babel/core/node_modules/resolve/package.json new file mode 100644 index 00000000000000..dfcfc497b34eaf --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/resolve/package.json @@ -0,0 +1,51 @@ +{ + "name": "resolve", + "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", + "version": "1.19.0", + "repository": { + "type": "git", + "url": "git://github.com/browserify/resolve.git" + }, + "main": "index.js", + "keywords": [ + "resolve", + "require", + "node", + "module" + ], + "scripts": { + "prepublish": "safe-publish-latest && cp node_modules/is-core-module/core.json ./lib/", + "prelint": "eclint check '**/*'", + "lint": "eslint --ext=js,mjs .", + "pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async", + "tests-only": "tape test/*.js", + "pretest": "npm run lint", + "test": "npm run --silent tests-only", + "posttest": "npm run test:multirepo && aud --production", + "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test" + }, + "devDependencies": { + "@ljharb/eslint-config": "^17.2.0", + "array.prototype.map": "^1.0.2", + "aud": "^1.1.3", + "eclint": "^2.8.1", + "eslint": "^7.13.0", + "object-keys": "^1.1.1", + "safe-publish-latest": "^1.1.4", + "tap": "0.4.13", + "tape": "^5.0.1" + }, + "license": "MIT", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "dependencies": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/resolve/readme.markdown b/tools/node_modules/@babel/core/node_modules/resolve/readme.markdown similarity index 67% rename from tools/node_modules/babel-eslint/node_modules/resolve/readme.markdown rename to tools/node_modules/@babel/core/node_modules/resolve/readme.markdown index f1b27063901cb3..f742c38dd48df8 100644 --- a/tools/node_modules/babel-eslint/node_modules/resolve/readme.markdown +++ b/tools/node_modules/@babel/core/node_modules/resolve/readme.markdown @@ -5,7 +5,7 @@ algorithm](https://nodejs.org/api/modules.html#modules_all_together) such that you can `require.resolve()` on behalf of a file asynchronously and synchronously -[![build status](https://secure.travis-ci.org/browserify/node-resolve.png)](http://travis-ci.org/browserify/node-resolve) +[![build status](https://secure.travis-ci.org/browserify/resolve.png)](http://travis-ci.org/browserify/resolve) # example @@ -43,6 +43,12 @@ $ node example/sync.js var resolve = require('resolve'); ``` +For both the synchronous and asynchronous methods, errors may have any of the following `err.code` values: + +- `MODULE_NOT_FOUND`: the given path string (`id`) could not be resolved to a module +- `INVALID_BASEDIR`: the specified `opts.basedir` doesn't exist, or is not a directory +- `INVALID_PACKAGE_MAIN`: a `package.json` was encountered with an invalid `main` property (eg. not a string) + ## resolve(id, opts={}, cb) Asynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`. @@ -55,15 +61,20 @@ options are: * opts.extensions - array of file extensions to search in order +* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search + * opts.readFile - how to read files asynchronously * opts.isFile - function to asynchronously test whether a file exists * opts.isDirectory - function to asynchronously test whether a directory exists -* `opts.packageFilter(pkg, pkgfile)` - transform the parsed package.json contents before looking at the "main" field +* opts.realpath - function to asynchronously resolve a potential symlink to its real path + +* `opts.packageFilter(pkg, pkgfile, dir)` - transform the parsed package.json contents before looking at the "main" field * pkg - package data * pkgfile - path to package.json + * dir - directory for package.json * `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package * pkg - package data @@ -79,6 +90,12 @@ options are: * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution * opts - the resolution options +* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this) + * request - the import specifier being resolved + * start - lookup path + * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + * opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` * opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. @@ -93,6 +110,7 @@ default `opts` values: paths: [], basedir: __dirname, extensions: ['.js'], + includeCoreModules: true, readFile: fs.readFile, isFile: function isFile(file, cb) { fs.stat(file, function (err, stat) { @@ -112,6 +130,13 @@ default `opts` values: return cb(err); }); }, + realpath: function realpath(file, cb) { + var realpath = typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; + realpath(file, function (realPathErr, realPath) { + if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr); + else cb(null, realPathErr ? file : realPath); + }); + }, moduleDirectory: 'node_modules', preserveSymlinks: true } @@ -128,12 +153,16 @@ options are: * opts.extensions - array of file extensions to search in order +* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search + * opts.readFile - how to read files synchronously * opts.isFile - function to synchronously test whether a file exists * opts.isDirectory - function to synchronously test whether a directory exists +* opts.realpathSync - function to synchronously resolve a potential symlink to its real path + * `opts.packageFilter(pkg, dir)` - transform the parsed package.json contents before looking at the "main" field * pkg - package data * dir - directory for package.json (Note: the second argument will change to "pkgfile" in v2) @@ -146,6 +175,18 @@ options are: * opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) + For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function + * request - the import specifier being resolved + * start - lookup path + * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this) + * request - the import specifier being resolved + * start - lookup path + * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + * opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` * opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. @@ -160,6 +201,7 @@ default `opts` values: paths: [], basedir: __dirname, extensions: ['.js'], + includeCoreModules: true, readFileSync: fs.readFileSync, isFile: function isFile(file) { try { @@ -179,15 +221,22 @@ default `opts` values: } return stat.isDirectory(); }, + realpathSync: function realpathSync(file) { + try { + var realpath = typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; + return realpath(file); + } catch (realPathErr) { + if (realPathErr.code !== 'ENOENT') { + throw realPathErr; + } + } + return file; + }, moduleDirectory: 'node_modules', preserveSymlinks: true } ``` -## resolve.isCore(pkg) - -Return whether a package is in core. - # install With [npm](https://npmjs.org) do: diff --git a/tools/node_modules/babel-eslint/node_modules/trim-right/license b/tools/node_modules/@babel/core/node_modules/safe-buffer/LICENSE similarity index 93% rename from tools/node_modules/babel-eslint/node_modules/trim-right/license rename to tools/node_modules/@babel/core/node_modules/safe-buffer/LICENSE index 654d0bfe943437..0c068ceecbd48f 100644 --- a/tools/node_modules/babel-eslint/node_modules/trim-right/license +++ b/tools/node_modules/@babel/core/node_modules/safe-buffer/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Feross Aboukhadijeh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tools/node_modules/@babel/core/node_modules/safe-buffer/README.md b/tools/node_modules/@babel/core/node_modules/safe-buffer/README.md new file mode 100644 index 00000000000000..e9a81afd0406f0 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/tools/node_modules/@babel/core/node_modules/safe-buffer/index.js b/tools/node_modules/@babel/core/node_modules/safe-buffer/index.js new file mode 100644 index 00000000000000..22438dabbbceef --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/safe-buffer/index.js @@ -0,0 +1,62 @@ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/tools/node_modules/@babel/core/node_modules/safe-buffer/package.json b/tools/node_modules/@babel/core/node_modules/safe-buffer/package.json new file mode 100644 index 00000000000000..623fbc3f6b0c48 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/safe-buffer/package.json @@ -0,0 +1,37 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.1.2", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + } +} diff --git a/tools/node_modules/@babel/core/node_modules/semver/LICENSE b/tools/node_modules/@babel/core/node_modules/semver/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/node_modules/@babel/core/node_modules/semver/README.md b/tools/node_modules/@babel/core/node_modules/semver/README.md new file mode 100644 index 00000000000000..f8dfa5a0df5fc4 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/semver/README.md @@ -0,0 +1,412 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install --save semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero digit in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the ranges comparators intersect + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). diff --git a/tools/node_modules/@babel/core/node_modules/semver/bin/semver b/tools/node_modules/@babel/core/node_modules/semver/bin/semver new file mode 100755 index 00000000000000..801e77f1303c15 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/semver/bin/semver @@ -0,0 +1,160 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + +var versions = [] + +var range = [] + +var inc = null + +var version = require('../package.json').version + +var loose = false + +var includePrerelease = false + +var coerce = false + +var identifier + +var semver = require('../semver') + +var reverse = false + +var options = {} + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 1)) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-c': case '--coerce': + coerce = true + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + var options = { loose: loose, includePrerelease: includePrerelease } + + versions = versions.map(function (v) { + return coerce ? (semver.coerce(v) || { version: v }).version : v + }).filter(function (v) { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } + + for (var i = 0, l = range.length; i < l; i++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error('--inc can only be used on a single version with no range') + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? 'rcompare' : 'compare' + versions.sort(function (a, b) { + return semver[compare](a, b, options) + }).map(function (v) { + return semver.clean(v, options) + }).map(function (v) { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach(function (v, i, _) { console.log(v) }) +} + +function help () { + console.log(['SemVer ' + version, + '', + 'A JavaScript implementation of the https://semver.org/ specification', + 'Copyright Isaac Z. Schlueter', + '', + 'Usage: semver [options] [ [...]]', + 'Prints valid versions sorted by SemVer precedence', + '', + 'Options:', + '-r --range ', + ' Print versions that match the specified range.', + '', + '-i --increment []', + ' Increment a version by the specified level. Level can', + ' be one of: major, minor, patch, premajor, preminor,', + " prepatch, or prerelease. Default level is 'patch'.", + ' Only one version may be specified.', + '', + '--preid ', + ' Identifier to be used to prefix premajor, preminor,', + ' prepatch or prerelease version increments.', + '', + '-l --loose', + ' Interpret versions and ranges loosely', + '', + '-p --include-prerelease', + ' Always include prerelease versions in range matching', + '', + '-c --coerce', + ' Coerce a string into SemVer if possible', + ' (does not imply --loose)', + '', + 'Program exits successfully if any valid version satisfies', + 'all supplied ranges, and prints all satisfying versions.', + '', + 'If no satisfying versions are found, then exits failure.', + '', + 'Versions are printed in ascending order, so supplying', + 'multiple versions to the utility will just sort them.' + ].join('\n')) +} diff --git a/tools/node_modules/@babel/core/node_modules/semver/package.json b/tools/node_modules/@babel/core/node_modules/semver/package.json new file mode 100644 index 00000000000000..69d2db162c9297 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/semver/package.json @@ -0,0 +1,28 @@ +{ + "name": "semver", + "version": "5.7.1", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "devDependencies": { + "tap": "^13.0.0-rc.18" + }, + "license": "ISC", + "repository": "https://github.com/npm/node-semver", + "bin": { + "semver": "./bin/semver" + }, + "files": [ + "bin", + "range.bnf", + "semver.js" + ], + "tap": { + "check-coverage": true + } +} diff --git a/tools/node_modules/@babel/core/node_modules/semver/range.bnf b/tools/node_modules/@babel/core/node_modules/semver/range.bnf new file mode 100644 index 00000000000000..d4c6ae0d76c9ac --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/tools/node_modules/@babel/core/node_modules/semver/semver.js b/tools/node_modules/@babel/core/node_modules/semver/semver.js new file mode 100644 index 00000000000000..d315d5d68b179e --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/semver/semver.js @@ -0,0 +1,1483 @@ +exports = module.exports = SemVer + +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} +} + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' + +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 + +// The actual regexps go on exports.re +var re = exports.re = [] +var src = exports.src = [] +var R = 0 + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++ +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' +var NUMERICIDENTIFIERLOOSE = R++ +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++ +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++ +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')' + +var MAINVERSIONLOOSE = R++ +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')' + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++ +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')' + +var PRERELEASEIDENTIFIERLOOSE = R++ +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')' + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++ +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' + +var PRERELEASELOOSE = R++ +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++ +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++ +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++ +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?' + +src[FULL] = '^' + FULLPLAIN + '$' + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?' + +var LOOSE = R++ +src[LOOSE] = '^' + LOOSEPLAIN + '$' + +var GTLT = R++ +src[GTLT] = '((?:<|>)?=?)' + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++ +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +var XRANGEIDENTIFIER = R++ +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' + +var XRANGEPLAIN = R++ +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?' + +var XRANGEPLAINLOOSE = R++ +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?' + +var XRANGE = R++ +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' +var XRANGELOOSE = R++ +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +var COERCE = R++ +src[COERCE] = '(?:^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])' + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++ +src[LONETILDE] = '(?:~>?)' + +var TILDETRIM = R++ +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') +var tildeTrimReplace = '$1~' + +var TILDE = R++ +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' +var TILDELOOSE = R++ +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++ +src[LONECARET] = '(?:\\^)' + +var CARETTRIM = R++ +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') +var caretTrimReplace = '$1^' + +var CARET = R++ +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' +var CARETLOOSE = R++ +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++ +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' +var COMPARATOR = R++ +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++ +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') +var comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++ +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$' + +var HYPHENRANGELOOSE = R++ +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$' + +// Star ranges basically just allow anything at all. +var STAR = R++ +src[STAR] = '(<|>)?=?\\s*\\*' + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + } +} + +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + var r = options.loose ? re[LOOSE] : re[FULL] + if (!r.test(version)) { + return null + } + + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} + +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null +} + +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} + +exports.SemVer = SemVer + +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } + + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + + var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) + + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() +} + +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} + +SemVer.prototype.toString = function () { + return this.version +} + +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return this.compareMain(other) || this.comparePre(other) +} + +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +} + +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + var i = 0 + do { + var a = this.prerelease[i] + var b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break + + default: + throw new Error('invalid increment argument: ' + release) + } + this.format() + this.raw = this.version + return this +} + +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } + + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} + +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre' + var defaultResult = 'prerelease' + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} + +exports.compareIdentifiers = compareIdentifiers + +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} + +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major +} + +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor +} + +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch +} + +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) +} + +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} + +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) +} + +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compare(a, b, loose) + }) +} + +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.rcompare(a, b, loose) + }) +} + +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} + +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} + +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 +} + +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} + +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} + +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} + +exports.cmp = cmp +function cmp (a, op, b, loose) { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b + + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) + } +} + +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } + + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) +} + +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var m = comp.match(r) + + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) + } + + this.operator = m[1] + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } +} + +Comparator.prototype.toString = function () { + return this.value +} + +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY) { + return true + } + + if (typeof version === 'string') { + version = new SemVer(version, this.options) + } + + return cmp(version, this.operator, this.semver, this.options) +} + +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + var rangeTmp + + if (this.operator === '') { + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) + } + + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')) + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')) + + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +} + +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + return new Range(range.value, options) + } + + if (!(this instanceof Range)) { + return new Range(range, options) + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First, split based on boolean or || + this.raw = range + this.set = range.split(/\s*\|\|\s*/).map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range) + } + + this.format() +} + +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} + +Range.prototype.toString = function () { + return this.range +} + +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + range = range.trim() + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[COMPARATORTRIM]) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace) + + // normalize spaces + range = range.split(/\s+/).join(' ') + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) + } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) + + return set +} + +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some(function (thisComparators) { + return thisComparators.every(function (thisComparator) { + return range.set.some(function (rangeComparators) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + }) + }) +} + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator (comp, options) { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') +} + +function replaceTilde (comp, options) { + var r = options.loose ? re[TILDELOOSE] : re[TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} + +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? re[CARETLOOSE] : re[CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } + + debug('caret return', ret) + return ret + }) +} + +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} + +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + ret = gtlt + M + '.' + m + '.' + p + } else if (xm) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (xp) { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], '') +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } + + return (from + ' ' + to).trim() +} + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + version = new SemVer(version, this.options) + } + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +} + +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} + +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} + +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} + +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) + + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} + +exports.validRange = validRange +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) +} + +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) + + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + var high = null + var low = null + + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} + +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} + +exports.coerce = coerce +function coerce (version) { + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + var match = version.match(re[COERCE]) + + if (match == null) { + return null + } + + return parse(match[1] + + '.' + (match[2] || '0') + + '.' + (match[3] || '0')) +} diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/LICENSE b/tools/node_modules/@babel/core/node_modules/source-map/LICENSE similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/LICENSE rename to tools/node_modules/@babel/core/node_modules/source-map/LICENSE diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/README.md b/tools/node_modules/@babel/core/node_modules/source-map/README.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/README.md rename to tools/node_modules/@babel/core/node_modules/source-map/README.md diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.debug.js b/tools/node_modules/@babel/core/node_modules/source-map/dist/source-map.debug.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.debug.js rename to tools/node_modules/@babel/core/node_modules/source-map/dist/source-map.debug.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.js b/tools/node_modules/@babel/core/node_modules/source-map/dist/source-map.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.js rename to tools/node_modules/@babel/core/node_modules/source-map/dist/source-map.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.min.js b/tools/node_modules/@babel/core/node_modules/source-map/dist/source-map.min.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/dist/source-map.min.js rename to tools/node_modules/@babel/core/node_modules/source-map/dist/source-map.min.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/array-set.js b/tools/node_modules/@babel/core/node_modules/source-map/lib/array-set.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/lib/array-set.js rename to tools/node_modules/@babel/core/node_modules/source-map/lib/array-set.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/base64-vlq.js b/tools/node_modules/@babel/core/node_modules/source-map/lib/base64-vlq.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/lib/base64-vlq.js rename to tools/node_modules/@babel/core/node_modules/source-map/lib/base64-vlq.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/base64.js b/tools/node_modules/@babel/core/node_modules/source-map/lib/base64.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/lib/base64.js rename to tools/node_modules/@babel/core/node_modules/source-map/lib/base64.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/binary-search.js b/tools/node_modules/@babel/core/node_modules/source-map/lib/binary-search.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/lib/binary-search.js rename to tools/node_modules/@babel/core/node_modules/source-map/lib/binary-search.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/mapping-list.js b/tools/node_modules/@babel/core/node_modules/source-map/lib/mapping-list.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/lib/mapping-list.js rename to tools/node_modules/@babel/core/node_modules/source-map/lib/mapping-list.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/quick-sort.js b/tools/node_modules/@babel/core/node_modules/source-map/lib/quick-sort.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/lib/quick-sort.js rename to tools/node_modules/@babel/core/node_modules/source-map/lib/quick-sort.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-map-consumer.js b/tools/node_modules/@babel/core/node_modules/source-map/lib/source-map-consumer.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/lib/source-map-consumer.js rename to tools/node_modules/@babel/core/node_modules/source-map/lib/source-map-consumer.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-map-generator.js b/tools/node_modules/@babel/core/node_modules/source-map/lib/source-map-generator.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/lib/source-map-generator.js rename to tools/node_modules/@babel/core/node_modules/source-map/lib/source-map-generator.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/source-node.js b/tools/node_modules/@babel/core/node_modules/source-map/lib/source-node.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/lib/source-node.js rename to tools/node_modules/@babel/core/node_modules/source-map/lib/source-node.js diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/lib/util.js b/tools/node_modules/@babel/core/node_modules/source-map/lib/util.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/lib/util.js rename to tools/node_modules/@babel/core/node_modules/source-map/lib/util.js diff --git a/tools/node_modules/@babel/core/node_modules/source-map/package.json b/tools/node_modules/@babel/core/node_modules/source-map/package.json new file mode 100644 index 00000000000000..048e3ae86099f8 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/source-map/package.json @@ -0,0 +1,72 @@ +{ + "name": "source-map", + "description": "Generates and consumes source maps", + "version": "0.5.7", + "homepage": "https://github.com/mozilla/source-map", + "author": "Nick Fitzgerald ", + "contributors": [ + "Tobias Koppers ", + "Duncan Beevers ", + "Stephen Crane ", + "Ryan Seddon ", + "Miles Elam ", + "Mihai Bazon ", + "Michael Ficarra ", + "Todd Wolfson ", + "Alexander Solovyov ", + "Felix Gnass ", + "Conrad Irwin ", + "usrbincc ", + "David Glasser ", + "Chase Douglas ", + "Evan Wallace ", + "Heather Arthur ", + "Hugh Kennedy ", + "David Glasser ", + "Simon Lydell ", + "Jmeas Smith ", + "Michael Z Goddard ", + "azu ", + "John Gozde ", + "Adam Kirkton ", + "Chris Montgomery ", + "J. Ryan Stinnett ", + "Jack Herrington ", + "Chris Truter ", + "Daniel Espeset ", + "Jamie Wong ", + "Eddy Bruël ", + "Hawken Rives ", + "Gilad Peleg ", + "djchie ", + "Gary Ye ", + "Nicolas Lalevée " + ], + "repository": { + "type": "git", + "url": "http://github.com/mozilla/source-map.git" + }, + "main": "./source-map.js", + "files": [ + "source-map.js", + "lib/", + "dist/source-map.debug.js", + "dist/source-map.js", + "dist/source-map.min.js", + "dist/source-map.min.js.map" + ], + "engines": { + "node": ">=0.10.0" + }, + "license": "BSD-3-Clause", + "scripts": { + "test": "npm run build && node test/run-tests.js", + "build": "webpack --color", + "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" + }, + "devDependencies": { + "doctoc": "^0.15.0", + "webpack": "^1.12.0" + }, + "typings": "source-map" +} diff --git a/tools/node_modules/babel-eslint/node_modules/source-map/source-map.js b/tools/node_modules/@babel/core/node_modules/source-map/source-map.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/source-map/source-map.js rename to tools/node_modules/@babel/core/node_modules/source-map/source-map.js diff --git a/tools/node_modules/babel-eslint/node_modules/supports-color/browser.js b/tools/node_modules/@babel/core/node_modules/supports-color/browser.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/supports-color/browser.js rename to tools/node_modules/@babel/core/node_modules/supports-color/browser.js diff --git a/tools/node_modules/babel-eslint/node_modules/supports-color/index.js b/tools/node_modules/@babel/core/node_modules/supports-color/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/supports-color/index.js rename to tools/node_modules/@babel/core/node_modules/supports-color/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/supports-color/license b/tools/node_modules/@babel/core/node_modules/supports-color/license similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/supports-color/license rename to tools/node_modules/@babel/core/node_modules/supports-color/license diff --git a/tools/node_modules/@babel/core/node_modules/supports-color/package.json b/tools/node_modules/@babel/core/node_modules/supports-color/package.json new file mode 100644 index 00000000000000..ad199f5cdb0436 --- /dev/null +++ b/tools/node_modules/@babel/core/node_modules/supports-color/package.json @@ -0,0 +1,53 @@ +{ + "name": "supports-color", + "version": "5.5.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "browser.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "dependencies": { + "has-flag": "^3.0.0" + }, + "devDependencies": { + "ava": "^0.25.0", + "import-fresh": "^2.0.0", + "xo": "^0.20.0" + }, + "browser": "browser.js" +} diff --git a/tools/node_modules/babel-eslint/node_modules/supports-color/readme.md b/tools/node_modules/@babel/core/node_modules/supports-color/readme.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/supports-color/readme.md rename to tools/node_modules/@babel/core/node_modules/supports-color/readme.md diff --git a/tools/node_modules/babel-eslint/node_modules/to-fast-properties/index.js b/tools/node_modules/@babel/core/node_modules/to-fast-properties/index.js similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/to-fast-properties/index.js rename to tools/node_modules/@babel/core/node_modules/to-fast-properties/index.js diff --git a/tools/node_modules/babel-eslint/node_modules/to-fast-properties/license b/tools/node_modules/@babel/core/node_modules/to-fast-properties/license similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/to-fast-properties/license rename to tools/node_modules/@babel/core/node_modules/to-fast-properties/license diff --git a/tools/node_modules/babel-eslint/node_modules/to-fast-properties/package.json b/tools/node_modules/@babel/core/node_modules/to-fast-properties/package.json similarity index 61% rename from tools/node_modules/babel-eslint/node_modules/to-fast-properties/package.json rename to tools/node_modules/@babel/core/node_modules/to-fast-properties/package.json index 2c80c243891203..7a64b2ccb13dce 100644 --- a/tools/node_modules/babel-eslint/node_modules/to-fast-properties/package.json +++ b/tools/node_modules/@babel/core/node_modules/to-fast-properties/package.json @@ -1,25 +1,23 @@ { + "name": "to-fast-properties", + "version": "2.0.0", + "description": "Force V8 to use fast properties for an object", + "license": "MIT", + "repository": "sindresorhus/to-fast-properties", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "bugs": { - "url": "https://github.com/sindresorhus/to-fast-properties/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Force V8 to use fast properties for an object", - "devDependencies": { - "ava": "0.0.4" - }, "engines": { "node": ">=4" }, + "scripts": { + "test": "node --allow-natives-syntax test.js" + }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/to-fast-properties#readme", "keywords": [ "object", "obj", @@ -31,14 +29,7 @@ "convert", "mode" ], - "license": "MIT", - "name": "to-fast-properties", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/to-fast-properties.git" - }, - "scripts": { - "test": "node --allow-natives-syntax test.js" - }, - "version": "2.0.0" -} \ No newline at end of file + "devDependencies": { + "ava": "0.0.4" + } +} diff --git a/tools/node_modules/babel-eslint/node_modules/to-fast-properties/readme.md b/tools/node_modules/@babel/core/node_modules/to-fast-properties/readme.md similarity index 100% rename from tools/node_modules/babel-eslint/node_modules/to-fast-properties/readme.md rename to tools/node_modules/@babel/core/node_modules/to-fast-properties/readme.md diff --git a/tools/node_modules/@babel/core/package.json b/tools/node_modules/@babel/core/package.json new file mode 100644 index 00000000000000..5f93e494ea7963 --- /dev/null +++ b/tools/node_modules/@babel/core/package.json @@ -0,0 +1,66 @@ +{ + "name": "@babel/core", + "version": "7.12.9", + "description": "Babel compiler core.", + "main": "lib/index.js", + "author": "Sebastian McKenzie ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-core" + }, + "keywords": [ + "6to5", + "babel", + "classes", + "const", + "es6", + "harmony", + "let", + "modules", + "transpile", + "transpiler", + "var", + "babel-core", + "compiler" + ], + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + }, + "browser": { + "./lib/config/files/index.js": "./lib/config/files/index-browser.js", + "./lib/transform-file.js": "./lib/transform-file-browser.js", + "./src/config/files/index.js": "./src/config/files/index-browser.js", + "./src/transform-file.js": "./src/transform-file-browser.js" + }, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.5", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helpers": "^7.12.5", + "@babel/parser": "^7.12.7", + "@babel/template": "^7.12.7", + "@babel/traverse": "^7.12.9", + "@babel/types": "^7.12.7", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "devDependencies": { + "@babel/helper-transform-fixture-test-runner": "7.12.1" + } +} \ No newline at end of file diff --git a/tools/node_modules/@babel/core/src/config/files/index-browser.js b/tools/node_modules/@babel/core/src/config/files/index-browser.js new file mode 100644 index 00000000000000..2fb0b6eba1b899 --- /dev/null +++ b/tools/node_modules/@babel/core/src/config/files/index-browser.js @@ -0,0 +1,96 @@ +// @flow + +import type { Handler } from "gensync"; + +import type { + ConfigFile, + IgnoreFile, + RelativeConfig, + FilePackageData, +} from "./types"; + +import type { CallerMetadata } from "../validation/options"; + +export type { ConfigFile, IgnoreFile, RelativeConfig, FilePackageData }; + +// eslint-disable-next-line require-yield +export function* findConfigUpwards( + rootDir: string, // eslint-disable-line no-unused-vars +): Handler { + return null; +} + +// eslint-disable-next-line require-yield +export function* findPackageData(filepath: string): Handler { + return { + filepath, + directories: [], + pkg: null, + isPackage: false, + }; +} + +// eslint-disable-next-line require-yield +export function* findRelativeConfig( + pkgData: FilePackageData, // eslint-disable-line no-unused-vars + envName: string, // eslint-disable-line no-unused-vars + caller: CallerMetadata | void, // eslint-disable-line no-unused-vars +): Handler { + return { pkg: null, config: null, ignore: null }; +} + +// eslint-disable-next-line require-yield +export function* findRootConfig( + dirname: string, // eslint-disable-line no-unused-vars + envName: string, // eslint-disable-line no-unused-vars + caller: CallerMetadata | void, // eslint-disable-line no-unused-vars +): Handler { + return null; +} + +// eslint-disable-next-line require-yield +export function* loadConfig( + name: string, + dirname: string, + envName: string, // eslint-disable-line no-unused-vars + caller: CallerMetadata | void, // eslint-disable-line no-unused-vars +): Handler { + throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`); +} + +// eslint-disable-next-line require-yield +export function* resolveShowConfigPath( + dirname: string, // eslint-disable-line no-unused-vars +): Handler { + return null; +} + +export const ROOT_CONFIG_FILENAMES = []; + +// eslint-disable-next-line no-unused-vars +export function resolvePlugin(name: string, dirname: string): string | null { + return null; +} + +// eslint-disable-next-line no-unused-vars +export function resolvePreset(name: string, dirname: string): string | null { + return null; +} + +export function loadPlugin( + name: string, + dirname: string, +): { filepath: string, value: mixed } { + throw new Error( + `Cannot load plugin ${name} relative to ${dirname} in a browser`, + ); +} + +export function loadPreset( + name: string, + dirname: string, +): { filepath: string, value: mixed } { + throw new Error( + `Cannot load preset ${name} relative to ${dirname} in a browser`, + ); +} diff --git a/tools/node_modules/@babel/core/src/config/files/index.js b/tools/node_modules/@babel/core/src/config/files/index.js new file mode 100644 index 00000000000000..2321fb7605d9aa --- /dev/null +++ b/tools/node_modules/@babel/core/src/config/files/index.js @@ -0,0 +1,31 @@ +// @flow + +import typeof * as indexBrowserType from "./index-browser"; +import typeof * as indexType from "./index"; + +// Kind of gross, but essentially asserting that the exports of this module are the same as the +// exports of index-browser, since this file may be replaced at bundle time with index-browser. +((({}: any): $Exact): $Exact); + +export { findPackageData } from "./package"; + +export { + findConfigUpwards, + findRelativeConfig, + findRootConfig, + loadConfig, + resolveShowConfigPath, + ROOT_CONFIG_FILENAMES, +} from "./configuration"; +export type { + ConfigFile, + IgnoreFile, + RelativeConfig, + FilePackageData, +} from "./types"; +export { + resolvePlugin, + resolvePreset, + loadPlugin, + loadPreset, +} from "./plugins"; diff --git a/tools/node_modules/@babel/core/src/transform-file-browser.js b/tools/node_modules/@babel/core/src/transform-file-browser.js new file mode 100644 index 00000000000000..fc1b12af0e50ae --- /dev/null +++ b/tools/node_modules/@babel/core/src/transform-file-browser.js @@ -0,0 +1,29 @@ +// @flow + +// duplicated from transform-file so we do not have to import anything here +type TransformFile = { + (filename: string, callback: Function): void, + (filename: string, opts: ?Object, callback: Function): void, +}; + +export const transformFile: TransformFile = (function transformFile( + filename, + opts, + callback, +) { + if (typeof opts === "function") { + callback = opts; + } + + callback(new Error("Transforming files is not supported in browsers"), null); +}: Function); + +export function transformFileSync() { + throw new Error("Transforming files is not supported in browsers"); +} + +export function transformFileAsync() { + return Promise.reject( + new Error("Transforming files is not supported in browsers"), + ); +} diff --git a/tools/node_modules/@babel/core/src/transform-file.js b/tools/node_modules/@babel/core/src/transform-file.js new file mode 100644 index 00000000000000..480afc1cf6f737 --- /dev/null +++ b/tools/node_modules/@babel/core/src/transform-file.js @@ -0,0 +1,40 @@ +// @flow + +import gensync from "gensync"; + +import loadConfig, { type InputOptions, type ResolvedConfig } from "./config"; +import { + run, + type FileResult, + type FileResultCallback, +} from "./transformation"; +import * as fs from "./gensync-utils/fs"; + +import typeof * as transformFileBrowserType from "./transform-file-browser"; +import typeof * as transformFileType from "./transform-file"; + +// Kind of gross, but essentially asserting that the exports of this module are the same as the +// exports of transform-file-browser, since this file may be replaced at bundle time with +// transform-file-browser. +((({}: any): $Exact): $Exact); + +type TransformFile = { + (filename: string, callback: FileResultCallback): void, + (filename: string, opts: ?InputOptions, callback: FileResultCallback): void, +}; + +const transformFileRunner = gensync<[string, ?InputOptions], FileResult | null>( + function* (filename, opts) { + const options = { ...opts, filename }; + + const config: ResolvedConfig | null = yield* loadConfig(options); + if (config === null) return null; + + const code = yield* fs.readFile(filename, "utf8"); + return yield* run(config, code); + }, +); + +export const transformFile: TransformFile = transformFileRunner.errback; +export const transformFileSync = transformFileRunner.sync; +export const transformFileAsync = transformFileRunner.async; diff --git a/tools/node_modules/@babel/eslint-parser/LICENSE b/tools/node_modules/@babel/eslint-parser/LICENSE new file mode 100644 index 00000000000000..f31575ec773bb1 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/LICENSE @@ -0,0 +1,22 @@ +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/tools/node_modules/@babel/eslint-parser/README.md b/tools/node_modules/@babel/eslint-parser/README.md new file mode 100644 index 00000000000000..8ee13ebda10ac1 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/README.md @@ -0,0 +1,124 @@ +# @babel/eslint-parser [![npm](https://img.shields.io/npm/v/@babel/eslint-parser.svg)](https://www.npmjs.com/package/@babel/eslint-parser) [![travis](https://img.shields.io/travis/babel/@babel/eslint-parser/main.svg)](https://travis-ci.org/babel/@babel/eslint-parser) [![npm-downloads](https://img.shields.io/npm/dm/@babel/eslint-parser.svg)](https://www.npmjs.com/package/@babel/eslint-parser) + +**@babel/eslint-parser** allows you to lint **ALL** valid Babel code with the fantastic +[ESLint](https://github.com/eslint/eslint). + +## When should I use @babel/eslint-parser? + +ESLint's default parser and core rules [only support the latest final ECMAScript standard](https://github.com/eslint/eslint/blob/a675c89573836adaf108a932696b061946abf1e6/README.md#what-about-experimental-features) and do not support experimental (such as new features) and non-standard (such as Flow or TypeScript types) syntax provided by Babel. @babel/eslint-parser is a parser that allows ESLint to run on source code that is transformed by Babel. + +**Note:** You only need to use @babel/parser-eslint if you are using Babel to transform your code. If this is not the case, please use the relevant parser for your chosen flavor of ECMAScript (note that the default parser supports all non-experimental syntax as well as JSX). + +## How does it work? + +ESLint allows for the use of [custom parsers](https://eslint.org/docs/developer-guide/working-with-custom-parsers). When using this plugin, your code is parsed by Babel's parser (using the configuration specified in your [Babel configuration file](https://babeljs.io/docs/en/configuration)) and the resulting AST is +transformed into an [ESTree](https://github.com/estree/estree)-compliant structure that ESLint can understand. All location info such as line numbers, +columns is also retained so you can track down errors with ease. + +**Note:** ESLint's core rules do not support experimental syntax and may therefore not work as expected when using `@babel/eslint-parser`. Please use the companion [`@babel/eslint-plugin`](https://github.com/babel/babel/tree/main/eslint/babel-eslint-plugin) plugin for core rules that you have issues with. + +## Usage + +### Installation + +```sh +$ npm install eslint @babel/core @babel/eslint-parser --save-dev +# or +$ yarn add eslint @babel/core @babel/eslint-parser -D +``` + +**Note:** @babel/eslint-parser requires `@babel/core@>=7.2.0` and a valid Babel configuration file to run. If you do not have this already set up, please see the [Babel Usage Guide](https://babeljs.io/docs/en/usage). + +### Setup + +To use @babel/eslint-parser, `"@babel/eslint-parser"` must be specified as the `parser` in your ESLint configuration file (see [here](https://eslint.org/docs/user-guide/configuring#specifying-parser) for more detailed information). + +**.eslintrc.js** + +```js +module.exports = { + parser: "@babel/eslint-parser", +}; +``` + +With the parser set, your configuration can be configured as described in the [Configuring ESLint](https://eslint.org/docs/user-guide/configuring) documentation. + +**Note:** The `parserOptions` described in the [official documentation](https://eslint.org/docs/user-guide/configuring#specifying-parser-options) are for the default parser and are not necessarily supported by @babel/eslint-parser. Please see the section directly below for supported `parserOptions`. + +### Additional parser configuration + +Additional configuration options can be set in your ESLint configuration under the `parserOptions` key. Please note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. + +- `requireConfigFile` (default `true`) can be set to `false` to allow @babel/eslint-parser to run on files that do not have a Babel configuration associated with them. This can be useful for linting files that are not transformed by Babel (such as tooling configuration files), though we recommend using the default parser via [glob-based configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns). Note: @babel/eslint-parser will not parse any experimental syntax when no configuration file is found. +- `sourceType` can be set to `"module"`(default) or `"script"` if your code isn't using ECMAScript modules. +- `allowImportExportEverywhere` (default `false`) can be set to `true` to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. Otherwise import and export declarations can only appear at a program's top level. +- `ecmaFeatures.globalReturn` (default `false`) allow return statements in the global scope when used with `sourceType: "script"`. +- `babelOptions` is an object containing Babel configuration [options](https://babeljs.io/docs/en/options) that are passed to Babel's parser at runtime. For cases where users might not want to use a Babel configuration file or are running Babel through another tool (such as Webpack with `babel-loader`). + +**.eslintrc.js** + +```js +module.exports = { + parser: "@babel/eslint-parser", + parserOptions: { + sourceType: "module", + allowImportExportEverywhere: false, + ecmaFeatures: { + globalReturn: false, + }, + babelOptions: { + configFile: "path/to/config.js", + }, + }, +}; +``` + +**.eslintrc.js using glob-based configuration** + +This configuration would use the default parser for all files except for those found by the `"files/transformed/by/babel/*.js"` glob. + +```js +module.exports = { + rules: { + indent: "error", + }, + overrides: [ + { + files: ["files/transformed/by/babel/*.js"], + parser: "@babel/eslint-parser", + }, + ], +}; +``` + +### Run + +```sh +$ ./node_modules/.bin/eslint yourfile.js +``` + +## Known issues + +Flow: + +> Check out [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype): An `eslint` plugin that makes flow type annotations global variables and marks declarations as used. Solves the problem of false positives with `no-undef` and `no-unused-vars`. + +- `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/@babel/eslint-parser/issues/130#issuecomment-111215076) + - Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'` +- `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/@babel/eslint-parser/issues/132#issuecomment-112815926) + +Modules/strict mode + +- `no-unused-vars: ["error", { vars: local }]` [#136](https://github.com/babel/@babel/eslint-parser/issues/136) + +Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for React/JSX issues. + +- `no-unused-vars` with jsx + +Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for other issues. + +## Questions and support + +If you have an issue, please first check if it can be reproduced with the default parser and with the latest versions of `eslint` and `@babel/eslint-parser`. If it is not reproducible with the default parser, it is most likely an issue with `@babel/eslint-parser`. + +For questions and support please visit the [`#discussion`](https://babeljs.slack.com/messages/discussion/) Babel Slack channel (sign up [here](https://github.com/babel/notes/issues/38)) or the ESLint [Gitter](https://gitter.im/eslint/eslint). diff --git a/tools/node_modules/babel-eslint/lib/analyze-scope.js b/tools/node_modules/@babel/eslint-parser/lib/analyze-scope.js similarity index 62% rename from tools/node_modules/babel-eslint/lib/analyze-scope.js rename to tools/node_modules/@babel/eslint-parser/lib/analyze-scope.js index 9ad95bd2517e4f..30dffb6711023a 100644 --- a/tools/node_modules/babel-eslint/lib/analyze-scope.js +++ b/tools/node_modules/@babel/eslint-parser/lib/analyze-scope.js @@ -1,55 +1,81 @@ "use strict"; -const t = require("@babel/types"); -const requireFromESLint = require("./require-from-eslint"); - -const escope = requireFromESLint("eslint-scope"); -const Definition = requireFromESLint("eslint-scope/lib/definition").Definition; -const OriginalPatternVisitor = requireFromESLint( - "eslint-scope/lib/pattern-visitor" -); -const OriginalReferencer = requireFromESLint("eslint-scope/lib/referencer"); -const fallback = require("eslint-visitor-keys").getKeys; -const childVisitorKeys = require("./visitor-keys"); - -const flowFlippedAliasKeys = t.FLIPPED_ALIAS_KEYS.Flow.concat([ - "ArrayPattern", - "ClassDeclaration", - "ClassExpression", - "FunctionDeclaration", - "FunctionExpression", - "Identifier", - "ObjectPattern", - "RestElement", -]); -const visitorKeysMap = Object.keys(t.VISITOR_KEYS).reduce(function(acc, key) { - const value = t.VISITOR_KEYS[key]; - if (flowFlippedAliasKeys.indexOf(value) === -1) { +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = analyzeScope; + +var _core = require("@babel/core"); + +var _eslintScope = _interopRequireDefault(require("eslint-scope")); + +var _definition = require("eslint-scope/lib/definition"); + +var _patternVisitor = _interopRequireDefault(require("eslint-scope/lib/pattern-visitor")); + +var _referencer = _interopRequireDefault(require("eslint-scope/lib/referencer")); + +var _eslintVisitorKeys = require("eslint-visitor-keys"); + +var _visitorKeys = _interopRequireDefault(require("./visitor-keys")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const flowFlippedAliasKeys = _core.types.FLIPPED_ALIAS_KEYS.Flow.concat(["ArrayPattern", "ClassDeclaration", "ClassExpression", "FunctionDeclaration", "FunctionExpression", "Identifier", "ObjectPattern", "RestElement"]); + +const visitorKeysMap = Object.entries(_core.types.VISITOR_KEYS).reduce((acc, [key, value]) => { + if (!flowFlippedAliasKeys.includes(value)) { acc[key] = value; } + return acc; }, {}); - const propertyTypes = { - // loops - callProperties: { type: "loop", values: ["value"] }, - indexers: { type: "loop", values: ["key", "value"] }, - properties: { type: "loop", values: ["argument", "value"] }, - types: { type: "loop" }, - params: { type: "loop" }, - // single property - argument: { type: "single" }, - elementType: { type: "single" }, - qualification: { type: "single" }, - rest: { type: "single" }, - returnType: { type: "single" }, - // others - typeAnnotation: { type: "typeAnnotation" }, - typeParameters: { type: "typeParameters" }, - id: { type: "id" }, + callProperties: { + type: "loop", + values: ["value"] + }, + indexers: { + type: "loop", + values: ["key", "value"] + }, + properties: { + type: "loop", + values: ["argument", "value"] + }, + types: { + type: "loop" + }, + params: { + type: "loop" + }, + argument: { + type: "single" + }, + elementType: { + type: "single" + }, + qualification: { + type: "single" + }, + rest: { + type: "single" + }, + returnType: { + type: "single" + }, + typeAnnotation: { + type: "typeAnnotation" + }, + typeParameters: { + type: "typeParameters" + }, + id: { + type: "id" + } }; -class PatternVisitor extends OriginalPatternVisitor { +class PatternVisitor extends _patternVisitor.default { ArrayPattern(node) { node.elements.forEach(this.visit, this); } @@ -57,81 +83,73 @@ class PatternVisitor extends OriginalPatternVisitor { ObjectPattern(node) { node.properties.forEach(this.visit, this); } + } -class Referencer extends OriginalReferencer { - // inherits. +class Referencer extends _referencer.default { visitPattern(node, options, callback) { if (!node) { return; } - // Visit type annotations. this._checkIdentifierOrVisit(node.typeAnnotation); - if (t.isAssignmentPattern(node)) { + + if (_core.types.isAssignmentPattern(node)) { this._checkIdentifierOrVisit(node.left.typeAnnotation); } - // Overwrite `super.visitPattern(node, options, callback)` in order to not visit `ArrayPattern#typeAnnotation` and `ObjectPattern#typeAnnotation`. if (typeof options === "function") { callback = options; - options = { processRightHandNodes: false }; + options = { + processRightHandNodes: false + }; } const visitor = new PatternVisitor(this.options, node, callback); visitor.visit(node); - // Process the right hand nodes recursively. if (options.processRightHandNodes) { visitor.rightHandNodes.forEach(this.visit, this); } } - // inherits. visitClass(node) { - // Decorators. this._visitArray(node.decorators); - // Flow type parameters. const typeParamScope = this._nestTypeParamScope(node); - // Flow super types. this._visitTypeAnnotation(node.implements); - this._visitTypeAnnotation( - node.superTypeParameters && node.superTypeParameters.params - ); - // Basic. + this._visitTypeAnnotation(node.superTypeParameters && node.superTypeParameters.params); + super.visitClass(node); - // Close the type parameter scope. if (typeParamScope) { this.close(node); } } - // inherits. visitFunction(node) { const typeParamScope = this._nestTypeParamScope(node); - // Flow return types. this._checkIdentifierOrVisit(node.returnType); - // Basic. super.visitFunction(node); - // Close the type parameter scope. if (typeParamScope) { this.close(node); } } - // inherits. visitProperty(node) { - if (node.value && node.value.type === "TypeCastExpression") { + var _node$value; + + if (((_node$value = node.value) == null ? void 0 : _node$value.type) === "TypeCastExpression") { this._visitTypeAnnotation(node.value); } + this._visitArray(node.decorators); + super.visitProperty(node); } @@ -140,8 +158,8 @@ class Referencer extends OriginalReferencer { const typeParamScope = this._nestTypeParamScope(node); - // TODO: Handle mixins this._visitArray(node.extends); + this.visit(node.body); if (typeParamScope) { @@ -169,6 +187,10 @@ class Referencer extends OriginalReferencer { this._visitClassProperty(node); } + ClassPrivateMethod(node) { + super.MethodDefinition(node); + } + DeclareModule(node) { this._visitDeclareX(node); } @@ -185,13 +207,13 @@ class Referencer extends OriginalReferencer { this._visitDeclareX(node); } - // visit OptionalMemberExpression as a MemberExpression. OptionalMemberExpression(node) { super.MemberExpression(node); } _visitClassProperty(node) { this._visitTypeAnnotation(node.typeAnnotation); + this.visitProperty(node); } @@ -201,16 +223,14 @@ class Referencer extends OriginalReferencer { } const typeParamScope = this._nestTypeParamScope(node); + if (typeParamScope) { this.close(node); } } _createScopeVariable(node, name) { - this.currentScope().variableScope.__define( - name, - new Definition("Variable", name, node, null, null, null) - ); + this.currentScope().variableScope.__define(name, new _definition.Definition("Variable", name, node, null, null, null)); } _nestTypeParamScope(node) { @@ -219,23 +239,21 @@ class Referencer extends OriginalReferencer { } const parentScope = this.scopeManager.__currentScope; - const scope = new escope.Scope( - this.scopeManager, - "type-parameters", - parentScope, - node, - false - ); + const scope = new _eslintScope.default.Scope(this.scopeManager, "type-parameters", parentScope, node, false); this.scopeManager.__nestScope(scope); + for (let j = 0; j < node.typeParameters.params.length; j++) { const name = node.typeParameters.params[j]; - scope.__define(name, new Definition("TypeParameter", name, name)); + + scope.__define(name, new _definition.Definition("TypeParameter", name, name)); + if (name.typeAnnotation) { this._checkIdentifierOrVisit(name); } } - scope.__define = function() { + + scope.__define = function () { return parentScope.__define.apply(parentScope, arguments); }; @@ -246,31 +264,33 @@ class Referencer extends OriginalReferencer { if (!node) { return; } + if (Array.isArray(node)) { node.forEach(this._visitTypeAnnotation, this); return; } - // get property to check (params, id, etc...) const visitorValues = visitorKeysMap[node.type]; + if (!visitorValues) { return; } - // can have multiple properties for (let i = 0; i < visitorValues.length; i++) { const visitorValue = visitorValues[i]; const propertyType = propertyTypes[visitorValue]; const nodeProperty = node[visitorValue]; - // check if property or type is defined + if (propertyType == null || nodeProperty == null) { continue; } + if (propertyType.type === "loop") { for (let j = 0; j < nodeProperty.length; j++) { if (Array.isArray(propertyType.values)) { for (let k = 0; k < propertyType.values.length; k++) { const loopPropertyNode = nodeProperty[j][propertyType.values[k]]; + if (loopPropertyNode) { this._checkIdentifierOrVisit(loopPropertyNode); } @@ -298,9 +318,9 @@ class Referencer extends OriginalReferencer { } _checkIdentifierOrVisit(node) { - if (node && node.typeAnnotation) { + if (node == null ? void 0 : node.typeAnnotation) { this._visitTypeAnnotation(node.typeAnnotation); - } else if (node && node.type === "Identifier") { + } else if ((node == null ? void 0 : node.type) === "Identifier") { this.visit(node); } else { this._visitTypeAnnotation(node); @@ -314,29 +334,23 @@ class Referencer extends OriginalReferencer { } } } + } -module.exports = function(ast, parserOptions) { +function analyzeScope(ast, parserOptions) { const options = { ignoreEval: true, optimistic: false, directive: false, - nodejsScope: - ast.sourceType === "script" && - (parserOptions.ecmaFeatures && - parserOptions.ecmaFeatures.globalReturn) === true, + nodejsScope: ast.sourceType === "script" && (parserOptions.ecmaFeatures && parserOptions.ecmaFeatures.globalReturn) === true, impliedStrict: false, sourceType: ast.sourceType, - ecmaVersion: parserOptions.ecmaVersion || 2018, - fallback, + ecmaVersion: parserOptions.ecmaVersion, + fallback: _eslintVisitorKeys.getKeys }; - - options.childVisitorKeys = childVisitorKeys; - - const scopeManager = new escope.ScopeManager(options); + options.childVisitorKeys = _visitorKeys.default; + const scopeManager = new _eslintScope.default.ScopeManager(options); const referencer = new Referencer(options, scopeManager); - referencer.visit(ast); - return scopeManager; -}; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/eslint-parser/lib/configuration.js b/tools/node_modules/@babel/eslint-parser/lib/configuration.js new file mode 100644 index 00000000000000..e8883cc58a5c20 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/lib/configuration.js @@ -0,0 +1,66 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.normalizeESLintConfig = normalizeESLintConfig; +exports.normalizeBabelParseConfig = normalizeBabelParseConfig; + +var _core = require("@babel/core"); + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function normalizeESLintConfig(options) { + const { + babelOptions = {}, + ecmaVersion = 2020, + sourceType = "module", + allowImportExportEverywhere = false, + requireConfigFile = true + } = options, + otherOptions = _objectWithoutPropertiesLoose(options, ["babelOptions", "ecmaVersion", "sourceType", "allowImportExportEverywhere", "requireConfigFile"]); + + return Object.assign({ + babelOptions, + ecmaVersion, + sourceType, + allowImportExportEverywhere, + requireConfigFile + }, otherOptions); +} + +function normalizeBabelParseConfig(options) { + var _options$babelOptions, _options$babelOptions2; + + const parseOptions = Object.assign({ + sourceType: options.sourceType, + filename: options.filePath + }, options.babelOptions, { + parserOpts: Object.assign({ + allowImportExportEverywhere: options.allowImportExportEverywhere, + allowReturnOutsideFunction: true, + allowSuperOutsideMethod: true + }, options.babelOptions.parserOpts, { + plugins: ["estree", ...((_options$babelOptions = (_options$babelOptions2 = options.babelOptions.parserOpts) == null ? void 0 : _options$babelOptions2.plugins) != null ? _options$babelOptions : [])], + ranges: true, + tokens: true + }), + caller: Object.assign({ + name: "@babel/eslint-parser" + }, options.babelOptions.caller) + }); + + if (options.requireConfigFile !== false) { + const config = (0, _core.loadPartialConfig)(parseOptions); + + if (config !== null) { + if (!config.hasFilesystemConfig()) { + throw new Error(`No Babel config file detected for ${config.options.filename}. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.`); + } + + return config.options; + } + } + + return parseOptions; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/eslint-parser/lib/convert/convertAST.js b/tools/node_modules/@babel/eslint-parser/lib/convert/convertAST.js new file mode 100644 index 00000000000000..4b9496c95fa6af --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/lib/convert/convertAST.js @@ -0,0 +1,158 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = convertAST; + +var _core = require("@babel/core"); + +var _visitorKeys = require("../visitor-keys"); + +function convertNodes(ast, code) { + const astTransformVisitor = { + noScope: true, + + enter(path) { + const { + node + } = path; + + if (node.innerComments) { + delete node.innerComments; + } + + if (node.trailingComments) { + delete node.trailingComments; + } + + if (node.leadingComments) { + delete node.leadingComments; + } + }, + + exit(path) { + const { + node + } = path; + + if (node.extra) { + delete node.extra; + } + + if (node == null ? void 0 : node.loc.identifierName) { + delete node.loc.identifierName; + } + + if (path.isTypeParameter()) { + node.type = "Identifier"; + node.typeAnnotation = node.bound; + delete node.bound; + } + + if (path.isQualifiedTypeIdentifier()) { + delete node.id; + } + + if (path.isObjectTypeProperty()) { + delete node.key; + } + + if (path.isObjectTypeIndexer()) { + delete node.id; + } + + if (path.isFunctionTypeParam()) { + delete node.name; + } + + if (path.isImportDeclaration()) { + delete node.isType; + } + + if (path.isTemplateLiteral()) { + for (let i = 0; i < node.quasis.length; i++) { + const q = node.quasis[i]; + q.range[0] -= 1; + + if (q.tail) { + q.range[1] += 1; + } else { + q.range[1] += 2; + } + + q.loc.start.column -= 1; + + if (q.tail) { + q.loc.end.column += 1; + } else { + q.loc.end.column += 2; + } + } + } + } + + }; + const state = { + source: code + }; + const oldVisitorKeys = new Map(); + + try { + for (const [type, visitorKey] of Object.entries(_visitorKeys.conflictTypes)) { + oldVisitorKeys.set(type, _core.types.VISITOR_KEYS[type]); + _core.types.VISITOR_KEYS[type] = visitorKey; + } + + for (const [type, visitorKey] of Object.entries(_visitorKeys.newTypes)) { + _core.types.VISITOR_KEYS[type] = visitorKey; + } + + (0, _core.traverse)(ast, astTransformVisitor, null, state); + } finally { + for (const type of Object.keys(_visitorKeys.newTypes)) { + delete _core.types.VISITOR_KEYS[type]; + } + + for (const type of Object.keys(_visitorKeys.conflictTypes)) { + _core.types.VISITOR_KEYS[type] = oldVisitorKeys.get(type); + } + } +} + +function convertProgramNode(ast) { + ast.type = "Program"; + ast.sourceType = ast.program.sourceType; + ast.body = ast.program.body; + delete ast.program; + delete ast.errors; + + if (ast.comments.length) { + const lastComment = ast.comments[ast.comments.length - 1]; + + if (ast.tokens.length) { + const lastToken = ast.tokens[ast.tokens.length - 1]; + + if (lastComment.end > lastToken.end) { + ast.range[1] = lastToken.end; + ast.loc.end.line = lastToken.loc.end.line; + ast.loc.end.column = lastToken.loc.end.column; + } + } + } else { + if (!ast.tokens.length) { + ast.loc.start.line = 1; + ast.loc.end.line = 1; + } + } + + if (ast.body && ast.body.length > 0) { + ast.loc.start.line = ast.body[0].loc.start.line; + ast.range[0] = ast.body[0].start; + } +} + +function convertAST(ast, code) { + convertNodes(ast, code); + convertProgramNode(ast); +} \ No newline at end of file diff --git a/tools/node_modules/babel-eslint/lib/babylon-to-espree/convertComments.js b/tools/node_modules/@babel/eslint-parser/lib/convert/convertComments.js similarity index 55% rename from tools/node_modules/babel-eslint/lib/babylon-to-espree/convertComments.js rename to tools/node_modules/@babel/eslint-parser/lib/convert/convertComments.js index 17d7117372946d..bbe5b6104086ed 100644 --- a/tools/node_modules/babel-eslint/lib/babylon-to-espree/convertComments.js +++ b/tools/node_modules/@babel/eslint-parser/lib/convert/convertComments.js @@ -1,17 +1,20 @@ "use strict"; -module.exports = function(comments) { - for (var i = 0; i < comments.length; i++) { - var comment = comments[i]; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = convertComments; + +function convertComments(comments) { + for (const comment of comments) { if (comment.type === "CommentBlock") { comment.type = "Block"; } else if (comment.type === "CommentLine") { comment.type = "Line"; } - // sometimes comments don't get ranges computed, - // even with options.ranges === true + if (!comment.range) { comment.range = [comment.start, comment.end]; } } -}; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/eslint-parser/lib/convert/convertTokens.js b/tools/node_modules/@babel/eslint-parser/lib/convert/convertTokens.js new file mode 100644 index 00000000000000..6d194e8886137b --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/lib/convert/convertTokens.js @@ -0,0 +1,150 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = convertTokens; + +var _core = require("@babel/core"); + +function convertTemplateType(tokens) { + let curlyBrace = null; + let templateTokens = []; + const result = []; + + function addTemplateType() { + const start = templateTokens[0]; + const end = templateTokens[templateTokens.length - 1]; + const value = templateTokens.reduce((result, token) => { + if (token.value) { + result += token.value; + } else if (token.type !== _core.tokTypes.template) { + result += token.type.label; + } + + return result; + }, ""); + result.push({ + type: "Template", + value: value, + start: start.start, + end: end.end, + loc: { + start: start.loc.start, + end: end.loc.end + } + }); + templateTokens = []; + } + + tokens.forEach(token => { + switch (token.type) { + case _core.tokTypes.backQuote: + if (curlyBrace) { + result.push(curlyBrace); + curlyBrace = null; + } + + templateTokens.push(token); + + if (templateTokens.length > 1) { + addTemplateType(); + } + + break; + + case _core.tokTypes.dollarBraceL: + templateTokens.push(token); + addTemplateType(); + break; + + case _core.tokTypes.braceR: + if (curlyBrace) { + result.push(curlyBrace); + } + + curlyBrace = token; + break; + + case _core.tokTypes.template: + if (curlyBrace) { + templateTokens.push(curlyBrace); + curlyBrace = null; + } + + templateTokens.push(token); + break; + + case _core.tokTypes.eof: + if (curlyBrace) { + result.push(curlyBrace); + } + + break; + + default: + if (curlyBrace) { + result.push(curlyBrace); + curlyBrace = null; + } + + result.push(token); + } + }); + return result; +} + +function convertToken(token, source) { + const type = token.type; + token.range = [token.start, token.end]; + + if (type === _core.tokTypes.name) { + token.type = "Identifier"; + } else if (type === _core.tokTypes.semi || type === _core.tokTypes.comma || type === _core.tokTypes.parenL || type === _core.tokTypes.parenR || type === _core.tokTypes.braceL || type === _core.tokTypes.braceR || type === _core.tokTypes.slash || type === _core.tokTypes.dot || type === _core.tokTypes.bracketL || type === _core.tokTypes.bracketR || type === _core.tokTypes.ellipsis || type === _core.tokTypes.arrow || type === _core.tokTypes.pipeline || type === _core.tokTypes.star || type === _core.tokTypes.incDec || type === _core.tokTypes.colon || type === _core.tokTypes.question || type === _core.tokTypes.template || type === _core.tokTypes.backQuote || type === _core.tokTypes.dollarBraceL || type === _core.tokTypes.at || type === _core.tokTypes.logicalOR || type === _core.tokTypes.logicalAND || type === _core.tokTypes.nullishCoalescing || type === _core.tokTypes.bitwiseOR || type === _core.tokTypes.bitwiseXOR || type === _core.tokTypes.bitwiseAND || type === _core.tokTypes.equality || type === _core.tokTypes.relational || type === _core.tokTypes.bitShift || type === _core.tokTypes.plusMin || type === _core.tokTypes.modulo || type === _core.tokTypes.exponent || type === _core.tokTypes.bang || type === _core.tokTypes.tilde || type === _core.tokTypes.doubleColon || type === _core.tokTypes.hash || type === _core.tokTypes.questionDot || type.isAssign) { + token.type = "Punctuator"; + if (!token.value) token.value = type.label; + } else if (type === _core.tokTypes.jsxTagStart) { + token.type = "Punctuator"; + token.value = "<"; + } else if (type === _core.tokTypes.jsxTagEnd) { + token.type = "Punctuator"; + token.value = ">"; + } else if (type === _core.tokTypes.jsxName) { + token.type = "JSXIdentifier"; + } else if (type === _core.tokTypes.jsxText) { + token.type = "JSXText"; + } else if (type.keyword === "null") { + token.type = "Null"; + } else if (type.keyword === "false" || type.keyword === "true") { + token.type = "Boolean"; + } else if (type.keyword) { + token.type = "Keyword"; + } else if (type === _core.tokTypes.num) { + token.type = "Numeric"; + token.value = source.slice(token.start, token.end); + } else if (type === _core.tokTypes.string) { + token.type = "String"; + token.value = source.slice(token.start, token.end); + } else if (type === _core.tokTypes.regexp) { + token.type = "RegularExpression"; + const value = token.value; + token.regex = { + pattern: value.pattern, + flags: value.flags + }; + token.value = `/${value.pattern}/${value.flags}`; + } else if (type === _core.tokTypes.bigint) { + token.type = "Numeric"; + token.value = `${token.value}n`; + } + + if (typeof token.type !== "string") { + delete token.type.rightAssociative; + } + + return token; +} + +function convertTokens(tokens, code) { + return convertTemplateType(tokens).filter(t => t.type !== "CommentLine" && t.type !== "CommentBlock").map(t => convertToken(t, code)); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/eslint-parser/lib/convert/index.js b/tools/node_modules/@babel/eslint-parser/lib/convert/index.js new file mode 100644 index 00000000000000..f7133e2222944f --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/lib/convert/index.js @@ -0,0 +1,20 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; + +var _convertTokens = _interopRequireDefault(require("./convertTokens")); + +var _convertComments = _interopRequireDefault(require("./convertComments")); + +var _convertAST = _interopRequireDefault(require("./convertAST")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _default(ast, code) { + ast.tokens = (0, _convertTokens.default)(ast.tokens, code); + (0, _convertComments.default)(ast.comments); + (0, _convertAST.default)(ast, code); +} \ No newline at end of file diff --git a/tools/node_modules/@babel/eslint-parser/lib/index.js b/tools/node_modules/@babel/eslint-parser/lib/index.js new file mode 100644 index 00000000000000..e61b78c1836148 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/lib/index.js @@ -0,0 +1,68 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parse = parse; +exports.parseForESLint = parseForESLint; + +var _semver = _interopRequireDefault(require("semver")); + +var _core = require("@babel/core"); + +var _package = _interopRequireDefault(require("../package.json")); + +var _configuration = require("./configuration"); + +var _convert = _interopRequireDefault(require("./convert")); + +var _analyzeScope = _interopRequireDefault(require("./analyze-scope")); + +var _visitorKeys = _interopRequireDefault(require("./visitor-keys")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +let isRunningMinSupportedCoreVersion = null; + +function baseParse(code, options) { + const minSupportedCoreVersion = ">=7.2.0"; + + if (typeof isRunningMinSupportedCoreVersion !== "boolean") { + isRunningMinSupportedCoreVersion = _semver.default.satisfies(_core.version, minSupportedCoreVersion); + } + + if (!isRunningMinSupportedCoreVersion) { + throw new Error(`@babel/eslint-parser@${_package.default.version} does not support @babel/core@${_core.version}. Please upgrade to @babel/core@${minSupportedCoreVersion}.`); + } + + let ast; + + try { + ast = (0, _core.parseSync)(code, (0, _configuration.normalizeBabelParseConfig)(options)); + } catch (err) { + if (err instanceof SyntaxError) { + err.lineNumber = err.loc.line; + err.column = err.loc.column; + } + + throw err; + } + + (0, _convert.default)(ast, code); + return ast; +} + +function parse(code, options = {}) { + return baseParse(code, (0, _configuration.normalizeESLintConfig)(options)); +} + +function parseForESLint(code, options = {}) { + const normalizedOptions = (0, _configuration.normalizeESLintConfig)(options); + const ast = baseParse(code, normalizedOptions); + const scopeManager = (0, _analyzeScope.default)(ast, normalizedOptions); + return { + ast, + scopeManager, + visitorKeys: _visitorKeys.default + }; +} \ No newline at end of file diff --git a/tools/node_modules/@babel/eslint-parser/lib/visitor-keys.js b/tools/node_modules/@babel/eslint-parser/lib/visitor-keys.js new file mode 100644 index 00000000000000..df9bc9e2b06864 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/lib/visitor-keys.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.conflictTypes = exports.newTypes = void 0; + +var _core = require("@babel/core"); + +var _eslintVisitorKeys = require("eslint-visitor-keys"); + +const newTypes = { + ChainExpression: _eslintVisitorKeys.KEYS.ChainExpression, + ImportExpression: _eslintVisitorKeys.KEYS.ImportExpression, + Literal: _eslintVisitorKeys.KEYS.Literal, + MethodDefinition: ["decorators"].concat(_eslintVisitorKeys.KEYS.MethodDefinition), + Property: ["decorators"].concat(_eslintVisitorKeys.KEYS.Property) +}; +exports.newTypes = newTypes; +const conflictTypes = { + ClassPrivateMethod: ["decorators"].concat(_eslintVisitorKeys.KEYS.MethodDefinition), + ExportAllDeclaration: _eslintVisitorKeys.KEYS.ExportAllDeclaration +}; +exports.conflictTypes = conflictTypes; + +var _default = Object.assign({}, newTypes, _core.types.VISITOR_KEYS, conflictTypes); + +exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/LICENSE b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/LICENSE new file mode 100644 index 00000000000000..d36a526f7ed5d1 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/LICENSE @@ -0,0 +1,22 @@ +Copyright JS Foundation and other contributors, https://js.foundation +Copyright (C) 2012-2013 Yusuke Suzuki (twitter: @Constellation) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/README.md b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/README.md new file mode 100644 index 00000000000000..7e7ce0d345cdf2 --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/README.md @@ -0,0 +1,54 @@ +# ESLint Scope + +ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope). + +## Usage + +Install: + +``` +npm i eslint-scope --save +``` + +Example: + +```js +var eslintScope = require('eslint-scope'); +var espree = require('espree'); +var estraverse = require('estraverse'); + +var ast = espree.parse(code); +var scopeManager = eslintScope.analyze(ast); + +var currentScope = scopeManager.acquire(ast); // global scope + +estraverse.traverse(ast, { + enter: function(node, parent) { + // do stuff + + if (/Function/.test(node.type)) { + currentScope = scopeManager.acquire(node); // get current function scope + } + }, + leave: function(node, parent) { + if (/Function/.test(node.type)) { + currentScope = currentScope.upper; // set to parent scope + } + + // do stuff + } +}); +``` + +## Contributing + +Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/eslint-scope/issues). + +## Build Commands + +* `npm test` - run all linting and tests +* `npm run lint` - run all linting + +## License + +ESLint Scope is licensed under a permissive BSD 2-clause license. diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/definition.js b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/definition.js new file mode 100644 index 00000000000000..172bfe23b5fdcf --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/definition.js @@ -0,0 +1,86 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +const Variable = require("./variable"); + +/** + * @class Definition + */ +class Definition { + constructor(type, name, node, parent, index, kind) { + + /** + * @member {String} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). + */ + this.type = type; + + /** + * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence. + */ + this.name = name; + + /** + * @member {espree.Node} Definition#node - the enclosing node of the identifier. + */ + this.node = node; + + /** + * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier. + */ + this.parent = parent; + + /** + * @member {Number?} Definition#index - the index in the declaration statement. + */ + this.index = index; + + /** + * @member {String?} Definition#kind - the kind of the declaration statement. + */ + this.kind = kind; + } +} + +/** + * @class ParameterDefinition + */ +class ParameterDefinition extends Definition { + constructor(name, node, index, rest) { + super(Variable.Parameter, name, node, null, index, null); + + /** + * Whether the parameter definition is a part of a rest parameter. + * @member {boolean} ParameterDefinition#rest + */ + this.rest = rest; + } +} + +module.exports = { + ParameterDefinition, + Definition +}; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/index.js b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/index.js new file mode 100644 index 00000000000000..0f16fa40f8323f --- /dev/null +++ b/tools/node_modules/@babel/eslint-parser/node_modules/eslint-scope/lib/index.js @@ -0,0 +1,165 @@ +/* + Copyright (C) 2012-2014 Yusuke Suzuki + Copyright (C) 2013 Alex Seville + Copyright (C) 2014 Thiago de Arruda + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * Escope (escope) is an ECMAScript + * scope analyzer extracted from the esmangle project. + *